Imports System.Web.Security Public Class SimpleLogin Inherits System.Web.UI.Page #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. Private Sub InitializeComponent() End Sub Protected WithEvents Label1 As System.Web.UI.WebControls.Label Protected WithEvents UserName As System.Web.UI.HtmlControls.HtmlInputText Protected WithEvents UserPassword As System.Web.UI.HtmlControls.HtmlInputText Protected WithEvents SignIn As System.Web.UI.HtmlControls.HtmlInputButton Protected WithEvents Label7 As System.Web.UI.WebControls.Label Protected WithEvents Label2 As System.Web.UI.WebControls.Label Protected WithEvents TABLE1 As System.Web.UI.HtmlControls.HtmlTable Protected WithEvents Persist As System.Web.UI.WebControls.CheckBox 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here End Sub Private Sub SignIn_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SignIn.ServerClick If FormsAuthentication.Authenticate(UserName.Value, UserPassword.Value) Then FormsAuthentication.RedirectFromLoginPage _ (UserName.Value, Persist.Checked) Else Label1.Text = "Invalid user name or password." End If End Sub End Class