
Partial Class Login
    Inherits System.Web.UI.Page
  Public bAuthenticated As Boolean = False

  Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
    Dim s As String
    bAuthenticated = Membership.ValidateUser(Login1.UserName, Login1.Password)
    If (bAuthenticated = True) Then
      FormsAuthentication.RedirectFromLoginPage("Default.aspx", False)
      e.Authenticated = bAuthenticated
    End If
    'bAuthenticated = Authenticate(Login1.UserName, Login1.Password)
    'If (bAuthenticated = True) Then
    '  FormsAuthentication.RedirectFromLoginPage("Default.aspx", False)
    '  'Response.Redirect("Default3.aspx")
    'End If
    s = Login1.UserName
  End Sub
  Private Function Authenticate(ByVal uid As String, ByVal pwd As String) As Boolean
    Return FormsAuthentication.Authenticate(uid, pwd)
  End Function

End Class
