How to create my custom RegularExpressionValidator that gets the RegularExpression and ErrorMessage from Resource file?
[RegularExpression(@"\d{5}(-\d{4})?",
ErrorMessageResourceType = typeof(Global), ErrorMessageResourceName = "regExpValforPostal_ErrorMessage")]
public string PostalCode { get; set; }
if your resources file called Validations.he.resx and inside it you have both 'RegexExpression' and 'ErrorMessage' you should use this:
UPDATE #1: Option 2 added
Option 1:
Option 2:
than you will use it like this: