I am having a slight issue with the use of ValidationSummary(true) to display model level errors. If the ModelState does not contain model errors (i.e. M
ValidationSummary(true)
M
@if (ViewContext.ViewData.ModelState.Where(x => x.Key == "").Any()) { @Html.ValidationSummary(true, null, new { @class = "ui-state-error" }) }
This checks if there are any model wide errors and only renders the summary when there are some.