在我的 MVC 4 应用程序中,我需要在帐户注册屏幕上进行验证;包含至少 1 个数字、1 个大写字母和 1 个小写字母字符的密码。我想拥有类似的模型类属性
[Display(Name = "Register_Password", ResourceType = typeof(VirtuOxAdmin))]
[Required(ErrorMessageResourceType = typeof(VirtuOxAdmin), ErrorMessageResourceName = "Register_PasswordRequired")]
[MinLength(5, ErrorMessageResourceType = typeof(VirtuOxAdmin), ErrorMessageResourceName = "Admin_CreateCustomer_PasswordMinLength")]
[MaxLength(32, ErrorMessageResourceType = typeof(VirtuOxAdmin), ErrorMessageResourceName = "Admin_CreateCustomer_PasswordMaxLength")]
[RegularExpression(@"\d", ErrorMessageResourceType = typeof(VirtuOxAdmin), ErrorMessageResourceName = "Admin_CreateCustomer_AtleastOneDigit")]
[RegularExpression("[A-Z]+", ErrorMessageResourceType = typeof(VirtuOxAdmin), ErrorMessageResourceName = "Admin_CreateCustomer_AtleastOneUChar")]
[RegularExpression("[a-z]+", ErrorMessageResourceType = typeof(VirtuOxAdmin), ErrorMessageResourceName = "Admin_CreateCustomer_AtleastOneLChar")]
public string Password { set; get; }
但我收到错误 Error Duplicate 'RegularExpression' 属性
如何编码以进行密码验证?