home *** CD-ROM | disk | FTP | other *** search
ASP.NET Web Form | 2003-06-06 | 712 b | 33 lines |
- <%@ Page language="VB" %>
-
- <script runat=server>
- Sub LoginBtn_Click(Sender As Object, E As EventArgs)
- If (username.Text = "abc") And (password.Text = "123") Then
- FormsAuthentication.RedirectFromLoginPage(username.Text, true)
- Else
- Msg.Text = "Error!"
- End If
- End Sub
- </script>
-
- <html>
- <head>
- </head>
- <body>
- <form runat="server">
- <h2>Login</h2>
-
- Username:
- <asp:TextBox id="username" runat="server" />
- <br />
- Password:
- <asp:TextBox id="password" TextMode="Password" runat="server" />
- <br />
- <asp:button id="LoginBtn" text="Login" OnClick="LoginBtn_Click" runat="server" />
- <p>
- <asp:Label id="Msg" ForeColor="red" runat="server" />
- </p>
- </form>
- </body>
- </html>
-