How To Change Password Validation in ASP.Net MVC Identity 2?

前端 未结 2 1581
温柔的废话
温柔的废话 2020-12-13 03:26

How To Change Password Validation in ASP.Net MVC5 Identity 2 ?

Thanks

2条回答
  •  一个人的身影
    2020-12-13 04:07

    In addition to Anthony Chu's answer,

    You may also need to change it in Models folder > AccountViewModel.cs > class RegisterViewModel (as well as class ResetPasswordViewModel)

    Change "MinimumLength = 6" (need to scroll right)

     [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; }
    

提交回复
热议问题