开发者

ASP.NET MVC 2 EnableClientValidation : validation group

开发者 https://www.devze.com 2023-01-02 10:31 出处:网络
I\'m using ASP.NET MVC 2,DataAnnotation and MicrosoftMvcValidation.js for validation. I have two forms in my view..is there a way to use Validat开发者_JAVA技巧ion Group for client side validation (lik

I'm using ASP.NET MVC 2, DataAnnotation and MicrosoftMvcValidation.js for validation. I have two forms in my view..is there a way to use Validat开发者_JAVA技巧ion Group for client side validation (like in ASP.NET Webforms).

thanks


The example I've seen with the nerd dinner (http://www.asp.net/mvc/videos/what-is-aspnet-mvc-80-minute-technical-video-for-developers-building-nerddinner) uses a partial class to modify the dinner model by adding validation to specific elements. This way validation can be handled at the server level but without server controls.

But... you can still use the validation controls with asp.net mvc if that's what you mean.


Did you mean to show summary of error(s)? If so you can use HTML helper for validation summary, like Html.ValidationSummary(...).

Hope this helps!

0

精彩评论

暂无评论...
验证码 换一张
取 消