Validation Attribute - checking a dynamic number of fields on a form ASP.NET MVC 2
I have a number of forms with checkboxes that need validating. For example I might have a form with 3 checkboxes and one of those 3 n开发者_JAVA技巧eeds ticking and another form with 50 boxes that might need at least one item checking.
Does anyone have a ValidationAttribute that would work under these circumstances.
Many thanks for any pointers.
You can do that with class-level validation attributes (as opposed to property-level attributes). I've written a blog article describing how to implement this on both the server and the client side if you want to make this really ajaxy... :-)
精彩评论