Client-side validation not firing for CompareAttribute DataAnnotation
I'm laying out a view that compares two password strings. The two properties in one of my models are pretty straightforward: [Required] [RegularExpression(@"(\S)+", ErrorMessage = "White space is not allowed")] [StringLength(20, MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "New Password")] public string NewPassword { get; set; } [Required] [DataType(DataType.Password)] [RegularExpression(@"(\S)+", ErrorMessage = "White space is not allowed")] [StringLength(20, MinimumLength = 6)] [Display(Name = "Confirm Password")] [Compare("NewPassword", ErrorMessage = "The new password