asp:login and lockout condition

J

jeff

I am using the asp:login control and want to change the login failure
message if the user has become locked out. I want to tell them to call
technical support to reset their password. Does anyone know how to do
this?
 
Joined
May 11, 2006
Messages
2
Reaction score
0
How about this code...

Protected Sub Login1_LoginError(ByVal sender As Object, ByVal e As System.EventArgs) Handles Login1.LoginError

Login1.FailureText = litLoginFailed.Text ' Error message for login-failed.

Dim sUserName As String = Login1.UserName
Dim oUser As MembershipUser = Nothing

If sUserName <> "" Then
oUser = Membership.GetUser(sUserName)
End If

If Not IsNothing(oUser) AndAlso oUser.IsLockedOut Then
Login1.FailureText = litLockout.Text ' Error message for lockout.
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top