I have properties declared in my view model like:
[Required(ErrorMessage = "The Date field is required for Start.")]
[Display(Name = "Start")]
public DateTime DateStart { get; set; }
However, I am still getting a default The Start field is required error message. I assume this is because a non-nullable DateTime
is implicitly required, and the Required
attribute is ignored. Is there a way to customise my error message for these specific properties, besides making them nullable?