title: MVC 4 Client side validation not working
body: <p>Trying to learn the basics of ASP.net MVC and cant quite understand why my client side validation isnt working.</p>
  
  <p>I have this in both my web.config files (1 is global 1 is in the views folder)</p>
  
  <pre><code>&lt;add key="ClientValidationEnabled" value="true" /&gt;
  &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
  </code></pre>
  
  <p>I have this in my _layout.cshtmlfile</p>
  
  <pre><code>@Scripts.Render("~/bundles/jquery")
  @Scripts.Render("~/Scripts/jquery.validate.unobtrusive.min.js")
  @Scripts.Render("~/Scripts/jquery.validate.min.js")
  </code></pre>
  
  <p>This is my view model for which im testing registration:</p>
  
  <pre><code>public class RegisterVM
      {
          [Required(ErrorMessage="Username Required")]
          public string username { get; set; }
  
          [RegularExpression(@"((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,20})")]
          [Required(ErrorMessage="Password Required")]
          public string password { get; set; }
  
          [Compare("password", ErrorMessage="Passwords do not match")]
          public string passwordConfirm { get; set; }
      }
  </code></pre>
  
  <p>And this is my html</p>
  
  <pre><code>@using(@Html.BeginForm()){
  
      @Html.LabelFor( model =&gt; model.username)
      @Html.EditorFor( model =&gt; model.username)
      @Html.ValidationMessageFor( model =&gt; model.username)&lt;br /&gt;
  
      @Html.LabelFor( model =&gt; model.password)
      @Html.PasswordFor( model =&gt; model.password)
      @Html.ValidationMessageFor( model =&gt; model.password)&lt;br /&gt;
  
      @Html.LabelFor( model =&gt; model.passwordConfirm)
      @Html.EditorFor( model =&gt; model.passwordConfirm)
      @Html.ValidationMessageFor( model =&gt; model.passwordConfirm)&lt;br /&gt;
  
      &lt;input type="submit" value="Register" /&gt;
  
  
  }
  </code></pre>
  
  <p>Didn't want to post here, ive read a few topics on here related but cant seem to fix my issues, when i click submit it's making post/get requests.</p>