Chapter 6. Validation
This chapter covers
We covered models in the previous chapter, and we’ll continue our examination of the M in MVC by looking at advanced scenarios related to models enabled by ASP.NET MVC. The framework provides support for rich and extensible user input validation. Validation support in the framework is important because user feedback is a common requirement in web applications. It makes sense for the framework to enable things most projects need.
Validation is a big feature in ASP.NET MVC, but it has grown over time. In the first version of the framework it was absent, and integrating third-party validation frameworks was difficult because the extensibility points didn’t exist. ASP.NET MVC 2 brought full support for validation frameworks, as well as built-in support for Microsoft’s Data Annotations library. The third version of the framework significantly has improved the client-side validation story, rounding out support for scenarios required by today’s web applications.