开发者

How to do client side dependent/partial validation in asp.net mvc 2

开发者 https://www.devze.com 2023-01-28 16:23 出处:网络
I have a 2 check boxesandcouple of text boxes associated with them .If i check first check box t开发者_如何学Pythonhen its associated text boxes must be validated and if i click second then second\'s

I have a 2 check boxes and couple of text boxes associated with them . If i check first check box t开发者_如何学Pythonhen its associated text boxes must be validated and if i click second then second's associated text boxes must be validated .

I have a model with all the properties binded for this view. how to add a custom data annotation attribute when such situation exists?


asp.net mvc 2 does not support contingent validation. However there is an open source library that incorporates data annotation to support contingent validation and provides you a way to hook it on the client side. I used it in my project and found it fairly good. You can find it here.

0

精彩评论

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

关注公众号