The Login.aspx page (VB) : Login « Login Security « ASP.Net






The Login.aspx page (VB)


<%@ Page Language="VB" %>
    
<script runat="server">
    Protected Sub Button1_Click(ByVal sender As Object, _
      ByVal e As System.EventArgs)
    
        If (TextBox1.Text = "A" And TextBox2.Text = "B") Then
            FormsAuthentication.RedirectFromLoginPage(TextBox1.Text, True)
        Else
            Response.Write("Invalid credentials")
        End If
    End Sub
</script>
    
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Login Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        Username<br />
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
        <br />
        Password<br />
        <asp:TextBox ID="TextBox2" runat="server"
         TextMode="Password"></asp:TextBox><br />
        <br />
        <asp:Button ID="Button1" OnClick="Button1_Click" runat="server"
         Text="Submit" />
    </div>
    </form>
</body>
</html>

 








Related examples in the same category

1.Providing a login for the end user using the Login control
2.A formatted Login control
3.The Login.aspx page (C#)
4.Windows Security
5.Forms Security Setup