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">
<div>
<asp:label id="Label1" runat="server" text="Username"></asp:label>
<asp:textbox id="username" runat="server"></asp:textbox>
</div>
<p>
<asp:label id="Label2" runat="server" text="Password"></asp:label>
<asp:textbox id="password" runat="server"></asp:textbox>
</p>
<p>
<asp:button id="Button1" runat="server" text="Login">
</asp:button></p>
</form>
<br>

 

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:

http://www.softwareandfinance.com/myfirstwebhandler/default.aspx