我有一个DropDownListFor @Html.DropDownListFor(model => model.Payment)
,其值为
@Html.TextBoxFor(model => model.PaymentType)
,我想只在用户从DropDownListFor中选择汇票时才使TextBoxFor必需,我有Mvc Foolproof,我试图使用RequiredIf 这是我的ViewModel
public string PaymentType { get; set; }
public string Payment{ get; set; }
答案 0 :(得分:0)
@Stephen Muecke
[RequiredIf("Payment", "money order")]