DataType ErrorMessage doesn't work. MVC4 DataType ErrorMessage doesn't seem to work. I have this dataannotation Attribute:
[DataType(DataType.DateTime, ErrorMessage = "Invalid date")]
public override DateTime? BirthDate { get; set; }
but client validation return this error:
The field BirthDate must be a date.
this is the Html portion:
<input Value="" class="date" data-val="true" data-val-date="The field BirthDate must be a date." data-val-required="El campo Fecha nacimiento es obligatorio" id="Patient_BirthDate" name="Patient.BirthDate" type="text" value="" />
Any idea?