Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp:PasswordRecovery validator in 2.0

Status
Not open for further replies.

mbiro

Programmer
Nov 20, 2001
304
I have an asp.net 2.0 application and I dropped a PasswordRecovery control on a page. The control works fine, but I have a problem with the validator. The control has a text box for the username and a submit button. If the text box is left blank and the button clicked, a red asterisk appears next to the textbox. Mouseover on the asterisk shows a tooltip 'User Name is required'. I cannot get the message to appear without the mouseover. In other words, I need the message to appear next the text box (or under) if the button is clicked and the fiels is blank.

I see the UserNameRequiredErrorMessage in the properties and it has a value. I tried tying a validation summary to the control, but no luck. What am I missing?
 
Check ValidationSummary control and set the ErrorMessage, Text, and Display properties.

Sharing the best from my side...

--Prashant--
 
Thanks for the reply. The validation summary wouldn't work because it put the message below the submit button instead of by the text box.

I did find the answer though. I used a <usernametemplate> to lay out the control. I found it in the VS 2005 documentation under PasswordRecovery.UserNameTemplate Property, in case any one else runs into this.

This was frustrating to me because the other Login controls in the toolbox allowed the client-side validation error message to show from within the properties, instead of just a non-descript red asterisk. The lack of this feature on this control made it appear that the control did not function properly to my QA department.

I hope this helps.
 
Hello.

You add a validation summary as mbiro said, or set the required field's validator text property from "*" to ""... (empty). With that, when there is error, it will be shown on it
 
That's the problem. On the passwordrecovery control, there is no validator text property, only stlyes. Clearing the '*' on all the other login controls does exactly what TipGiver says, bit not on this control (at least that I could find)...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top