Often we have NULL Date data(no matter it is a nullable column or brand new record where date field not initialized), and when the NULL reaches the MVC View it will be shown as "01/01/0001", unless we change the date to a proper date value, the data would choke the background database upon submission, is there simple ways to achieve following 2 things?:

  1. Using validation error etc, automatically detect such illegal date values (if the field is required), and prevent submission
  2. Or on the server side to automatically restore the bad values to NULL (if the field can be NULL).

By 'automatically', I meant no field specific coding using JavaScript or server side C#.


Related posts

Recent Viewed