Thursday, 29 August 2013

How in the model we can use localization string for the error message

How in the model we can use localization string for the error message

I use this class
[Required(ErrorMessage = "Username is required") ]
public string UserName { get; set; }
Though when I try to use this code
[Required(ErrorMessage = Localization.UserNameRequired) ]
public string UserName { get; set; }
It throws the compile error and doesn't allow me to use this localized
string. Am I doing something wrong?

No comments:

Post a Comment