相关疑难解决方法(0)

如果另一个属性在MVC 3/jQuery Validator上具有值,则验证属性

如果Prop1为true,我如何在属性Prop2中使用必需的验证?

Ex:
public bool Prop1 { get; set; }

[Required] // I need this validation only if the Prop1 is true.
public string Prop2 { get; set; }
Run Code Online (Sandbox Code Playgroud)

任何的想法?我需要在客户端和服务器端.谢谢

validation asp.net-mvc jquery-validate asp.net-mvc-3

5
推荐指数
2
解决办法
6442
查看次数