views:

22

answers:

1

How do I list all generated errors in the same div?

Something like this:

<div id="errors">
  <ul>
    <li>Email is invalid</li>
    <li>Firstname is required</li>
  </ul>
</div>
A: 

Try using

<%=Html.ValidationSummary()%>

There is a section about it in this article: http://www.asp.net/mvc/tutorials/performing-simple-validation-cs

stimms
Nothing happens.
jgauffin
Do you have individual error messages working?
stimms
Everything works with server-side validation, but not client-side.
jgauffin
Did you call Html.EnableClientValidation(); and added appropriate javascript? See section entitled Making It Work In The Client in http://haacked.com/archive/2009/11/19/aspnetmvc2-custom-validation.aspx
stimms
I've followed the quide and tried with both jquery scripts and the pure ms validation scripts. I'm calling EnableClientValidation in my view.
jgauffin