Last post Apr 28, 2014 07:28 PM by Jackxxx
Apr 28, 2014 03:49 PM|Jackxxx|LINK
I'm using a login control with a layout template that has a username textbox and have the forgotpassword link showing. I need to disable it if a specific user tried to login. How can I do that?
Apr 28, 2014 04:55 PM|anas|LINK
I think you can handle the LoginError event of the Login control, then if the user name (can be taken directly from the username text box) matches with what you are looking for, you use get a reference to the link that is inside the login control (LoginControlID.FindControl("LinkID").Visible=false.
Maybe better to show the markup incase it didn't work.
Apr 28, 2014 07:28 PM|Jackxxx|LINK
Is it possible to do this from the Forgotpassword.aspx page?
I tried the following but it did not work. I'm not sure the username textbox in the login control has a text property. So I don;t know how to check the user name?
Sub PasswordRecovery1_VerifyingUser(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs)
If PasswordRecovery1.UserName = "SpecificUserName" Then
PasswordRecovery1.UserNameInstructionText = "You must enter another name."
e.Cancel = True
PasswordRecovery1.UserNameInstructionText = "Enter your User Name to receive your password."