We've been working with ASP.Net MVC2 based web app. We're using DataAnnotations for model validation and we've also implemented some of our own validation attributes. All is working good and the user gets the error summary (if any) after postback. Now, we plan to migrate to MVC3 in near future but meanwhile, we want to make the most out of jQuery & AJAX based validations.
Note that we've not been using any MS libraries for AJAX or validation available with MVC prjects. Our approach is to keep things as simple & clean as possible so we've been using pure jQuery based plugins. We want to enable client-side validation & remote validation using jQuery for which I believe jquery-plugin-validation is one of the best alternatives. It also supports remote validations.
Example: http://weblogs.asp.net/cibrax/archive/2008/08/01/combining-jquery-validation-with-asp-net-mvc.aspx
Automation:
APPROACH #1: Here it is mentioned that using "MicrosoftMvcJQueryValidation.js"will automate these validations - any comments?
APPROACH #: Here's another approach which seems to provide even more automation using jQuery DataAnnotations - any comments?
If I'm on the right track kindly based on your experience let me know which approach is better.
Further, is it true that this approach will help us migrate the validations easily as we migrate to MVC3.
Example: http://develoq.net/2011/asp-net-mvc-3-remote-validation-with-jquery/
Any better suggestions are welcome. Thank you.
PS: In any case we'll persist the model level validations.