I'm displaying errors on my form with the use of
<%= Html.ValidationSummary("Please review the errors below") %>
My domain object inherits from a base class and I am finding that the base class data annotation properties are being displayed at the bottom of the list. This goes against the order in which they appear in my form.
Is there any way of specifying what order the errors should be displayed?
Example:
public class ClassA { [Required]public string AProperty; }
public class ClassB : ClassA { [Required]public string BProperty; }
My form (strongly typed view of ClassB):
AProperty: <%= Html.TextBoxFor(m => m.AProperty) %>
BProperty: <%= Html.TextBoxFor(m => m.BProperty) %>
Validation errors appear as:
The BProperty is required.
The AProperty is required.