[StringLength(255, MinimumLength=6,
ErrorMessage = "Password can't be less that 6 characters"),
Required,
DataType(DataType.Password),
Display(Name = "Password")]
public string Password { get; set; }
[StringLength(255, MinimumLength = 6), Required, DataType(DataType.Password),
Compare("Password"), Display(Name = "Repeat password")]
public string RepeatPassword { get; set; }
如果用户输入的密码少于6&密码不匹配。错误信息是:
密码不能少于6个字符'重复密码'和 '密码'不匹配。
如果重复密码小于6&密码不匹配错误是:
'重复密码'和'密码'不匹配。字段重复 password必须是最小长度为6且最大为的字符串 长度为255。
如果是这种情况我只想要'重复密码'和'密码'不匹配才能显示。我怎么能这样做?