I am trying to override the max length error message in ASP.net MVC. Basically, I would like to make the error message string as follow:
[DisplayName] length should not be more than [x]. However, I do not know how to include the displayname attribute value inside.
public class MyMaxLengthAttribute : MaxLengthAttribute
{
public MyMaxLengthAttribute(int length) : base(length)
{
ErrorMessage = "What should I input here"
}
}