I am working on a project with Asp.Net MVC3
In a View I have @Html.ValidationSummary(true) and as usually it produces
<div class="validation-summary-errors">
<ul>
<li>Something bad Happened!</li>
</ul>
</div>
How can I extend this ValidationSummary to MyValidationSummary and produces the Html Code template something like this:
<div class="notification warning">
<span></span>
<div class="text"> <p>Something bad Happened!</p> </div>
</div>
This question details the procedure of writing custom validation summary.
EDIT
This will do what you want:
The code is self explanatory; just enumerating through modelstate errors and wrapping errors in dom element of your choice. There is an error that is if i use it like:
It will display html tags on the page as text rather than rendering it.
This works fine.