NotEqualTo Not Working Client Side in MVC 5

Aug 10, 2015 at 9:18 PM
Hello:

First of all thanks for a awesome extension for the DataAnnotation validations.

My situation is as follows:
  1. Project in MVC5 with VS2013
  2. DataAnnotation in ViewModels
  3. Comparing 3 dropdowns not to be equal to each other. Works ServerSide not client-side
  4. Fields to be validated are in a PartialView
  5. Sample of DataAnnotation Declaration:
    [NotEqualTo("SecurityQuestion2", ErrorMessageResourceName = "SecurityQuestion1Match",
        ErrorMessageResourceType = typeof(MCS.Provinet.Resouces.GeneralResources))]
    public int SecurityQuestion1 { get; set; }
    
    [NotEqualTo("SecurityQuestion3", ErrorMessageResourceName = "SecurityQuestion2Match",
        ErrorMessageResourceType = typeof(MCS.Provinet.Resouces.GeneralResources))]
    public int SecurityQuestion2 { get; set; }
    
    [NotEqualTo("SecurityQuestion1", ErrorMessageResourceName = "SecurityQuestion3Match",
        ErrorMessageResourceType = typeof(MCS.Provinet.Resouces.GeneralResources))]
    public int SecurityQuestion3 { get; set; }
    
My scripts are as follows:
<script src="/Scripts/jquery.unobtrusive-ajax.js"></script>
<script src="/Scripts/jquery.validate.js"></script>
<script src="/Scripts/jquery.validate.unobtrusive.js"></script>
<script src="/Scripts/mvcfoolproof.unobtrusive.min.js"></script>