0
我爲我的MVC 5應用程序使用MVC Foolproof Validation。多MVC萬無一失驗證
我想說:EventPlanEnd是,除非EventPlanStart填充需要不如果是,請確保EventPlanEnd> EventPlanStart。這似乎並沒有工作...
public Nullable<System.DateTime> EventPlanStart { get; set; }
[RequiredIfTrue("EventPlanStart")]
[GreaterThan("EventPlanStart")]
public Nullable<System.DateTime> EventPlanEnd { get; set; }
任何想法我可以做到這一點與數據註釋?
[MVC防呆驗證使用PassOnNull - 可空或 「01.01.0001 00:00:00」]的可能的複製(http://stackoverflow.com/questions/12406297/mvc- foolproof-validation-using-passonnull-nullable-or-01-01-0001-000000) – CodeCaster
''[RequiredIfTrue]'只適用於其他屬性爲'bool'的情況 –