ASP MVC 5 Client Validation for Range of Datetimes

后端 未结 5 1643
旧巷少年郎
旧巷少年郎 2020-12-06 12:44

I want to check an Datetime field in a form. The field is valid between 01/10/2008 and 01/12/2008. Here is how I defined the viewmodel property:

    [Require         


        
5条回答
  •  死守一世寂寞
    2020-12-06 13:24

    Checking the range date can also be done using FluentValidation, that can be another solution to your problem, check my answer her. Hope this helps

    MVC model validation for date

提交回复
热议问题