Ok I've spent a lot of time reading all the various blog posts on Validation. We are currently in the middle of writing an app in MVC 2.0 and noticed the Model Validation Providers, can anyone provide any examples or links to good solid examples?
Cheers
asked Oct 7, 2009 at 12:40
LiamB
18.6k19 gold badges79 silver badges122 bronze badges
2 Answers 2
This is an excellent example of the new jQuery validation provider (which is currently the default) in MVC 2 Preview 2 - http://blogs.msdn.com/rickandy/archive/2009/10/03/client-side-validation-for-mvc-2-p2.aspx
answered Oct 7, 2009 at 12:46
Kieron
27.2k16 gold badges81 silver badges124 bronze badges
Sign up to request clarification or add additional context in comments.
6 Comments
Nick Larsen
For more examples of DataAnnatations validation provider, see ScottGu's blog: weblogs.asp.net/scottgu/archive/2009/07/31/…
LiamB
Is this a Model Validation Provider?
Kieron
Yes, the baked in jQuery validator is based on the Model Validation Provider. You can create your own, or get others and simply plug them in.
LiamB
ok cool, how would you go about server validation as well? Javascript validation is kinda out of the question because of the nature of the app.
Craig Stuntz
The MVC 2 preview 2 validation does both client and server validation. The server validation is done during model binding.
|
answered Oct 7, 2009 at 12:44
Daniel Elliott
22.9k10 gold badges67 silver badges82 bronze badges
1 Comment
LiamB
This seems to be the way to do it MVC 1.0 I'm looking for the new way to do it in MVC 2.0
default