title: Strange behavior in Unobtrusive validation in ASP.NET MVC 4.0
body: <p>I am using ASP.NET MVC 4.0 and I am experiencing a strange behavior with the JQuery Unobtrusive Validation.</p>
  
  <p>I have placed its related scripts into my layout.cshtml and when I open up the view and hit the submit button, the validation messages are coming and up and suddenly the server call is hit. i.e the debugger steps into the server code for POST event.</p>
  
  <p>So basically, both the things are happening here. The client side validation as well as the server side event.</p>
  
  <p>I can see the messages firing up yet the execution seems to continue and go to server side.</p>
  
  <p>This is my view code :</p>
  
  <pre><code> @using (Html.BeginForm("AddUser", "Registration", FormMethod.Post, new { enctype = "multipart/form-data", id = "frm1" }))
          {
              //some HTML markup
              .
              .
              .
              &lt;div class="col-md-1 divside-left-first"&gt;
                  &lt;button type="submit" value="Save" id="Btnsave" class="btn ui-state-default medium"&gt;&amp;nbsp;Submit&amp;nbsp;&lt;/button&gt;
              &lt;/div&gt;
          }
  </code></pre>
  
  <p>I have placed the following scripts into the layout.cshtml file <em>at the bottom</em> and they are rendered properly on the browser. I checked.</p>
  
  <pre><code>&lt;script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Apart from that, I haven't used any other scripts with these except the native JQuery.js script. </p>
  
  <p>Things I have already tried :</p>
  
  <ul>
  <li>Putting scripts <em>on the top section</em>. Didn't work.</li>
  <li>Changing button type from button to input. Didn't work.</li>
  <li>Tried putting scripts into section view instead of layout.cshtml. Didn't work.</li>
  </ul>
  
  <p>Any help or suggestion as to what I am doing wrong here or not getting would be appreciated.</p>