home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 September / INTERNET107.ISO / pc / projects / aspnetpass / login.aspx < prev    next >
Encoding:
ASP.NET Web Form  |  2003-06-06  |  712 b   |  33 lines

  1. <%@ Page language="VB" %>
  2.  
  3. <script runat=server>
  4. Sub LoginBtn_Click(Sender As Object, E As EventArgs)
  5.     If (username.Text = "abc") And (password.Text = "123") Then
  6.       FormsAuthentication.RedirectFromLoginPage(username.Text, true)
  7.     Else
  8.       Msg.Text = "Error!"
  9.     End If
  10. End Sub
  11. </script>
  12.  
  13. <html>
  14. <head>
  15. </head>
  16. <body>
  17. <form runat="server">
  18. <h2>Login</h2>
  19.  
  20. Username:
  21. <asp:TextBox id="username" runat="server" />
  22. <br />
  23. Password:
  24. <asp:TextBox id="password" TextMode="Password" runat="server" />
  25. <br />
  26. <asp:button id="LoginBtn" text="Login" OnClick="LoginBtn_Click" runat="server" />
  27. <p>
  28. <asp:Label id="Msg" ForeColor="red" runat="server" />
  29. </p>
  30. </form>
  31. </body>
  32. </html>
  33.