Say I have this property in my model:
[DisplayName("test")]
[Required(ErrorMessage = "required")]
public DateTime? SomeDate { get; set; }
when you type in "asdf" in Html.TextBoxFor(model => model.SomeDate)
, you get the validation error message "The value 'asdf' is not valid for test.".
How do you modify that message? ASP.NET MVC ignored [DataType(DataType.DateTime, ErrorMessage = 'some other message')]
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…