MVC Foolproof Validation using PassOnNull - Nullable or “01.01.0001 00:00:00”

后端 未结 1 816
旧巷少年郎
旧巷少年郎 2021-01-17 06:58

I try tovalidate two dates (start -> end) where only the first ist required, but when the user enters the second date it must be greater than the first. I\'m using the MVC F

相关标签:
1条回答
  • 2021-01-17 07:51

    Ok after reading http://foolproof.codeplex.com/discussions/220498 on Codeplex I now know it works the other way round:

    <Required()> _
    <DisplayName("Event Start")> _
    <LessThan("EventEnd", PassOnNull:=True)> _
    Public Property EventStart As Nullable(Of DateTime)
    
    <DisplayName("Event End")> _
    Public Property EventEnd As Nullable(Of DateTime)
    
    0 讨论(0)
提交回复
热议问题