Answers for "data annotation for passwords"

0

data annotation for passwords

[Required]
[StringLength(18, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[RegularExpression(@"^((?=.*[a-z])(?=.*[A-Z])(?=.*\d)).+$"]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
Posted by: Guest on May-30-2020
0

data annotation for passwords

[Required]
    [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
    [DataType(DataType.Password)]
    [Display(Name = "Password")]
    public string Password { get; set; }
Posted by: Guest on May-30-2020

Browse Popular Code Answers by Language