Custom RegularExpressionAttribute missing data-val-regex-pattern for client-side validation
I have created the following custom RegularExpressionAttribute [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] public class AlphaNumericAttribute: RegularExpressionAttribute, IClientValidatable { public AlphaNumericAttribute() : base("^[-A-Za-z0-9]+$") { } public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context) { yield return new ModelClientValidationRule { ErrorMessage = FormatErrorMessage(metadata.GetDisplayName()), ValidationType = "alphanumeric" }; } } The field in the ViewModel is