Is there ways to implement model validation with complex rules like "if one radio button was selected it's necessary to select one radio from another radio buttons group. If radio button with additiona开发者_JS百科l textbox was selected so it's necessary to fill it too."?
It'll be perfect if this way will relate to DataAnnotations
attributes. I only know that we can use some additional framework to reach this. But, you know, it'll be more beautiful if we have some native solution.
Thanks you guys in advance!
I don't think MVC-2 has a native solution but I believe MVC-3 supports the concept of remote validation using a RemoteAttribute. I think more information can be found:
MVC 3 Release notes overview
RemoteAttribute
精彩评论