Guest User

Untitled

a guest
Mar 10th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.31 KB | None | 0 0
  1. Protected Sub Login1_LoginError(ByVal sender As Object,
  2.     ByVal e As System.EventArgs) Handles Login1.LoginError
  3. If Login1.UserName = String.Empty And Login1.Password = String.Empty Then
  4.     lblLoginErrorDetails.Text = "Please enter your username and password."
  5. ElseIf Login1.UserName = String.Empty Then
  6.     lblLoginErrorDetails.Text = "Please enter your username."
  7. ElseIf Login1.Password = String.Empty Then
  8.     lblLoginErrorDetails.Text = "Please enter your password."
  9. Else
  10.     Dim userInfo As MembershipUser = Membership.GetUser(Login1.UserName)
  11.     LoginError.Visible = "True"
  12.     If userInfo Is Nothing Then
  13.         lblLoginErrorDetails.Text = "There is no user in the database
  14.            with the username " & Login1.UserName & ". Please try again."
  15.     Else
  16.         If Not userInfo.IsApproved Then
  17.             lblLoginErrorDetails.Text = "Your account has not yet been
  18.                approved. Please try again later."
  19.         ElseIf userInfo.IsLockedOut Then
  20.             lblLoginErrorDetails.Text = "Your account has been locked
  21.                out due to maximum incorrect login attempts. Please
  22.                contact the site administrator."
  23.         Else
  24.             lblLoginErrorDetails.Text = "Your password is incorrect,
  25.                please try again."
  26.         End If
  27.     End If
  28. End If
  29. End Sub
Add Comment
Please, Sign In to add comment