Question

I have a view with @Html.ValidationSummary("Please check the following errors:") at the top of a form. The text "Please check the following errors:" is always rendered, whether or not the model state is valid (I have verified the model state both in the view and in the controller).

Can anyone point me to why this is happening? I feel like I'm missing something pretty basic here - but I'm stumped!

Was it helpful?

Solution

Uh - I just realised why. It was because I'd removed the default styles for the validation summary! Adding this back in solved my issue:

.validation-summary-valid
{
    display: none;
}

D'oh!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top