MVC3 How to define custom error messages using annotations?
问题 I have a DateTime field(that can accept multiple date time formats, so it is pain to create Regex patter) When in the field I'm entering something like "Aaaaaa", I'm getting error message: The value 'Aaaaa' is not valid for OwnerBirthDate Model looks: [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd.MM.yyyy}")] [Required(ErrorMessage = "*")] public DateTime? OwnerBirthDate { get; set; } View: @Html.TextBoxFor(x => x.OwnerBirthDate) How can I define custom error message