How localize ErrorMessage in DataAnnotation?
You need to use ErrorMessageResourceName
and ErrorMessageResourceType
properties.
For example like this:
[Compare("Password", ErrorMessageResourceName = "ConfirmPasswordErrorMessage",
ErrorMessageResourceType=typeof(<<type_of_your_resoruce_class>>)]
public string ConfirmPassword { get; set; }
Hope this helps!
Regards, Uros