在我的模型层中,我为密码编写了这样的代码:
[Required]
[StringLength (100,ErrorMessage
="The {0} must be atleast {2} characters long.",MinimumLength=6)]
[DataType(DataType.Password)]
[Display(Name="Password")]
public string Password { get; set; }
但它在我的注册页面中没有受到影响。