Asp – Form input validation options in ASP.NET MVC 1.0+

asp.net-mvcasp.net-mvc-2

A number of questions have been asked on this topic before, but since ASP.NET MVC is moving quite fast I wanted to re-ask the question:

What would you recommend for providing form input validation in ASP.NET MVC?

Requirements:

  • Server-side checking
  • Client-side (JavaScript) checking
  • Should cover the basics such as mandatory fields, numeric range validation, regex validation

(So basically all (or most) of the stuff that the ASP.NET WebForms validation controls do)

Current options seem to be:

  1. Validator Toolkit on CodePlex
  2. Jumping to ASP.NET MVC 2 Preview 1 (Our application is for internal use and go-live is in 6 months, so we might be comfortable using the preview)

Best Answer

xVal should be good choice in your case.