开发者

Complex model validation

开发者 https://www.devze.com 2023-03-18 19:48 出处:网络
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 additi

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

0

精彩评论

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