What are the ways to validate form data (in ASP.NET MVC and C#) such as input fields. I try jquery validator but failed. Are there other ways?
+1
A:
MVC v2 has DataAnnotation Validation Support, see Scott Gu's post on this topic.
RandomNoob
2009-12-21 20:24:41
You can use DataAnnotation Validation in ASP.NET MVC v1.0 as well. http://www.superexpert.com/blog/archive/2008/09/10/asp-net-mvc-tip-43-use-data-annotation-validators.aspx
Nissan Fan
2009-12-21 22:33:58
how validate input field who does not have model function
Ognjen
2009-12-23 01:53:18
A:
ASP.NET MVC 2.0 beta has jQuery validator integrated. Might be worth a look.
Robert Harvey
2009-12-21 20:24:44
You can do it with MVC 1.0: see here http://www.superexpert.com/blog/archive/2008/09/10/asp-net-mvc-tip-43-use-data-annotation-validators.aspx
Nissan Fan
2009-12-21 22:34:28
A:
I recommend use MVC 2 RC, jQuery and jQuery.validate plugin. How it works you can read on Phil Haack's blog. Please, be careful. Phil wrote article in time of MVC 2 Beta. About issues with implementation on RC you can read here: ASP.NET MVC 2 RC client side validation not working.
Martin
2010-01-13 22:25:08