I am using Model validation in ASP.NET MVC3. The compare emails validation is not firing at all. I installed DataAnnoatations Extensions for MVC3 also. Below is my code.
[Display(ResourceType = typeof(Resources.Views.Account.Local.Create), Name = "EMail1")]
[Required(ErrorMessageResourceType = typeof(Resources.Views.Account.Local.Create),
ErrorMessageResourceName = "rqEMail1")]
[RegularExpression(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*",
ErrorMessageResourceType = typeof(Resources.Views.Account.Local.Create),
ErrorMessageResourceName = "regxEMail1")]
public string EMail1 { get; set; }
[Required]
[Compare("EMail1", ErrorMessageResourceType = typeof(Resources.Views.Account.Local.Create),
ErrorMessageResourceName = "cmpEmail")]
[RegularExpression(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*",
ErrorMessageResourceType = typeof(Resources.Views.Account.Local.Create),
ErrorMessageResourceName = "regxEMail2")]
public string EMail2 { get; set; }