CompareAttribute ValidationResult has an empty MemberNames
Code:
public class RegistrationViewModel {
[Required]
[StringLength(50, MinimumLength = 5)]
public String Password { get; set; }
[Required]
[Compare("Password")]
public String ComfirmPassword { get; set; }
}
The ValidationResult produced by CompareAttribute has an empty
MemberNames. I would expect MemberNames to include at least
"ConfirmPassword". Is there any way to get the expected result without
making a custom CompareAttribute?
No comments:
Post a Comment