When you decorate a model object\'s property with the Required
attribute and don\'t specify ErrorMessage
or ResourceType/Name
you get the
Have you tried creating a derived class of RequiredAttribute and overriding the FormatErrorMessage method? This should work:
public class MyRequiredAttribute : System.ComponentModel.DataAnnotations.RequiredAttribute
{
public override string FormatErrorMessage(string name)
{
return base.FormatErrorMessage(string.Format("This is my error for {0}", name));
}
}