Let’s start simple by creating form controls: <table> <tr><td>Usernname</td><td><asp:TextBox ID=”user” runat=”server”></asp:TextBox></td></tr> <tr><td>Password</td><td><asp:TextBox ID=”password” runat=”server” TextMode=”Password”></asp:TextBox></td></tr> <tr><td></td><td><asp:Button ID=”Button1″ OnClick=”submit” Text=”Login” runat=”server” causesValidation=”true” /></td></tr> </table> Now add some form validation: <table> <tr><td>Usernname</td><td><asp:TextBox ID=”user” runat=”server”></asp:TextBox> <asp:RequiredFieldValidator ID=”RequiredFieldValidator1″ runat=”server” ControlToValidate=”user” ValidationGroup=”UserCheck” ErrorMessage=” <font color=’red’> « Username is required!</font> “> </asp:RequiredFieldValidator> </td></tr> <tr><td>Password</td><td><asp:TextBox ID=”password” runat=”server” TextMode=”Password”></asp:TextBox> <asp:RequiredFieldValidator ID=”RequiredFieldValidator2″ runat=”server” ControlToValidate=”password” […]
Archive for the 'Encryption' Tag
Login – password encrypt
Login.aspx [ form page ] Login.asp.vb [code behind] Imports System.IO Imports System.Data.OleDb Imports System.Web.UI.WebControls.ImageButton Imports System.Web.UI.WebControls.TextBox Imports System.Web.SessionState Imports System.Web.Security Imports System.Web Partial Class Control_Panel Inherits System.Web.UI.Page Protected Sub Login_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles Login.Click ‘/ defining controls Dim usn As TextBox Dim pwd As TextBox ‘/ binding controls usn = […]
Login
~ Access db backend & SHA1 or MD5 encryption ~ Web.config <system.web> <authentication mode=”Forms”> <forms loginUrl=”Login.aspx” timeout=”2880″/> </authentication> </system.web> Login.aspx <form id=”form1″ runat=”server” > <table > <tr> <td colspan=”2″><b>Login Form</b></td> </tr> <tr> <td>Intranet Username: </td><td style=”color: Red;” > <asp:TextBox ID=”usn” runat=”server” TextMode=”password” /> <asp:RequiredFieldValidator ID=”ReqVal_1″ controltovalidate=”usn” validationgroup=”Login1″ runat=”server” ErrorMessage=” ? ” > </asp:RequiredFieldValidator> </td> </tr> […]