Use the
DateTimeInput and the
DateRangeAttribute of my Mvc Controls Toolkit. You can define both the previous constraint, on the client side and on the server side, easily by placing two DateRange attributes on the ExpiryDate each for each constraint and by adding a new property called
ToDay to your ViewModel (it has just a get returning today). User would not be able to enter a date is nort allowed at all. You have also the option, when the user choose a storageDate, to change expiryDate automatically to make the constraint holds instead
of limiting the value of ExpiryDate.
The example application here show an example of use. Other examples of the use of the DateTimeInput are...pratically in almost all tutorials.
francesco ab...
All-Star
20954 Points
3286 Posts
Re: Custom DateTime Validation for MVC 3 unobtrusive client side validation
Oct 18, 2011 08:49 AM|LINK
Use the DateTimeInput and the DateRangeAttribute of my Mvc Controls Toolkit. You can define both the previous constraint, on the client side and on the server side, easily by placing two DateRange attributes on the ExpiryDate each for each constraint and by adding a new property called ToDay to your ViewModel (it has just a get returning today). User would not be able to enter a date is nort allowed at all. You have also the option, when the user choose a storageDate, to change expiryDate automatically to make the constraint holds instead of limiting the value of ExpiryDate.
The example application here show an example of use. Other examples of the use of the DateTimeInput are...pratically in almost all tutorials.
Mvc Controls Toolkit | Data Moving Plug-in Videos