One of the common requirements when creating an application is to validate data and inform the user if something goes wrong. ASP.NET Webforms offered validation controls and an optional validation summary. When invalid values were entered in a specific control, an error message was displayed. The validation summary would show all of the generated error messages.
The ASP.NET MVC framework offers the same possibilities but in a different manner. The
HtmlHelper class provides two methods:
ValidationSummary. The first one will display a message for a specific control, while the latter will render a complete summary of all generated validation errors.
The examples in this topic are based on an ASP.NET MVC web application, ...