Model Validation / ASP.NET MVC 3 - Conditional Required Attribute

前端 未结 4 929
温柔的废话
温柔的废话 2020-12-04 16:51

I\'m having trouble with my ASP.NET MVC 3 application. I have 2 propertiesin my model whereby I only want 1 of them required in my view based on whichever one is empty. So f

4条回答
  •  旧时难觅i
    2020-12-04 17:46

    Here is a MSDN blog entry about conditional validations: http://blogs.msdn.com/b/simonince/archive/2011/02/04/conditional-validation-in-asp-net-mvc-3.aspx

提交回复
热议问题