I have created a static method that returns a string that describes the error message in the chosen languages, but I can't make it work. I have searched for an answer, but only found a way to do it with: [Display(Name = "Name")]
to my own: [DisplayResource.DisplayName("InfoName")]
Something like this, must be possible with this:
[StringLength(200, MinimumLength = 5, ErrorMessage = DisplayResource.DisplayError("ErrName"))]
[EmailAddress(ErrorMessage = DisplayResource.DisplayError("ErrUseEMail"))]
[StringLength(20, MinimumLength = 5, ErrorMessage = DisplayResource.DisplayError("ErrPswLength"))]
[Compare("Password", ErrorMessage = DisplayResource.DisplayError("ErrPswMatch"))]
and so on....
I have searched for an answer, but maybe I haven't used the right words to describe my problem?