Validation at the model level or client-side level using ASP.NET MVC3

I am using ASP.NET MVC3 with jQuery Validate +, the unobtrusive validation support that ships with MVC3. Works fine for almost everything, but I have one view where there is some kind of validation on the scale of everything I need to do, and I'm not sure how to use validation events that occur as part of MVC3 + Validate + Unobtrusive. Actual verification will only take a few lines of code. I just don’t know where to connect this code.

I would like to bind an existing validation flow so that when the standard validation detects errors with individual fields and adds warning messages for them, my form error message will also appear in the validation summary.

PS I understand how to add the correct check of the model level on the server side (Scott is just on the blog ), but I feel that it would be strange if some kind of check occurred on the client and others only on the server. The user can see client validation errors, correct them, and then try to submit the form and only then receive a model level validation error message.

+5
source share
2 answers

, Remote Validation Asp MVC3. , , , . , , , : -)

http://www.aaronstannard.com/post/2010/12/07/remote-validation-asp-net-mvc3.aspx

/Victor

+1

. JavaScript.

№ 1 -:

-2

All Articles