I have a problem with the validation message for Regular expression. Localised messages appear everywhere except for one field below:
[LocalizedDisplayName("LblWordCount", NameResourceType = typeof(ValidationMessages.Messages))]
[Required(ErrorMessageResourceName = "ErrorFieldRequired", ErrorMessageResourceType = typeof(ValidationMessages.Messages))]
[RegularExpression(@"^[0-9]+$", ErrorMessage = "", ErrorMessageResourceName = "ErrorDigitsOnly", ErrorMessageResourceType = typeof(ValidationMessages.Messages))]
public Int32 WordCount { get; set; }
It doesn't matter what I put in the resx file for "ErrorDigitsOnly" - the default message always kicks in: "The value 'zxzza1' is not valid for Word Count." For instance - message for the [Required] appears correctly.
Any suggestions for that?
Cheers, 303
I have checked the code for spelling mistakes but couldn't find any.
ErrorMessage = ""from the attribute worked for me