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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation summary

Status
Not open for further replies.

Cineno

Programmer
Jul 24, 2006
142
US
Hello. I'm very new to ASP.Net, and have recently begun learning about the validations controls. I've been able to properly use the validation controls to validate required fields, and email addresses. I had it show the error message next to the control it was validating.

I have a login page, and instead of having the validation messages show next to the user name or password, I'd like it show them in an Invalid Login stylized div that I have. Here is an example:

<% '''''''Only show messages div if Username or Password is invalid''''''' %>
<div class="messages">
<div id="message-error" class="message message-error">
<div class="image">
<img src="resources/images/icons/error.png" alt="Error" height="32" />
</div>
<div class="text">
<h6>Invalid Login</h6>
<span>
<%'''''''Show Username or Password invalid messages''''''' %>
</span>
</div>


</div>

</div>

Does anyone know who to accomplish this? Since it would have to refer to the Username and Password validations, I think it has to use a validation summary, but I couldn't that to work properly. Any ideas?
 
Thanks for the response.

I get that I can put the div between the Validation Summary tags, and then if an error occurs it would show the div.

I think the main problem I'm having is how can I get the error text from the Validation Summary to be shown in the section I have commented above?

All examples I've found have the error text in the validation tag, but I'm not sure how I can use the Validation Summary tag in one place, but have it's text appear in another.
 
you wouldn't. you would use the validation summary instead of your custom html. the validation summary does just what is says. summaries all the errors into one location within the html.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top