I am looking at ASP.NET MVC 3.0 custom validation and found some articles about this:
First : http://tdryan.blogspot.com/2010/12/aspnet-mvc-3-custom-validation.html
Second : http://thepursuitofalife.com/asp-net-mvc-3-unobtrusive-javascript-validation-with-custom-validators/
Third : http://samipoimala.com/it/2010/11/29/unobtrusive-client-validation-in-asp-net-mvc-3/
But each of the articles describes slightly different approaches ...
In the first article, they create CustomValidatonAtributeand CustomValidaorInherited form DataAnnotationsModelValidator<CustomValidatonAtribute>, than they register everything in Global.asx, without any custom jQuery validation methods.
In the second article, they created only ValidatonAttributewitch implemented IClientValidatable, after which they impose the jQueryValidator user method on the user method.
In article Three, they package ModelClientValidatorinherited from ModelClientValidationRuleplus a custom client-side jQuery validation method.
A bit confusing approach to the choice, but I think that o will go with Third , at first it looks for me more easily than others.
I know that I may need to try each of them to see how it looks in practice, and it looks like it depends on what kind of verification is required.
Should I inherit my custom validator from DataAnnotationsModelValidatorfrom ModelClientValidationRule?
But can there be any opinions on this?