Chapter 6. Validation

 

This chapter covers

  • Implementing Data Annotations
  • Extending the ModelMetadataProvider
  • Enabling client-side validation
  • Creating custom client side validators

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.

6.1. Server-side validation

 
 
 

6.2. Client-side validation

 
 
 
 

6.3. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest