Software & Finance

ASP.NET - Create a simple login form .aspx


Use your wizard to create a empty web application and add a new web form using right mouse click on project and add new item and select the web form option:



Have two text boxes to keyin user name and password and then login button.


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MyFirstWebHandler._Default" %>

<title>My First Web Application</title>
<form id="form2" runat="server" action="Welcome.ashx">
<asp:label id="Label1" runat="server" text="Username"></asp:label>
<asp:textbox id="username" runat="server"></asp:textbox>
<asp:label id="Label2" runat="server" text="Password"></asp:label>
<asp:textbox id="password" runat="server"></asp:textbox>
<asp:button id="Button1" runat="server" text="Login">


Note that we have not yet implemented welcome.ashx specified in form action="Welcome.ashx". ashx is a web handler.
Click here to read more on implementing this handler.

Refer to the following link on how it appears on the web: