Validation Summary Section Styles

The first time that you add a validation summary section to an ASP.NET MVC project, you’ll notice that it always displays, even when the form is in a valid state and there no messages to display. Luckily, this is easy to fix. ASP.NET MVC will add a CSS class named validation-summary-valid to the summary section’s outer most

element. So, to hide the summary section we can just define a style for that class like this:

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

That’s all there is to it!

In case you’re wondering, the Fitness Frog web app styles that were provided to you already includes this style, so that’s why we didn’t need to add it ourselves.