title: jQuery Mobile Validation in Asp.Net MVC5
body: <p>I'm creating a jQuery Mobile based ASP.NET MVC 5 application utilizing the jQuery validation. Ealier validation was working fine but its stopped working suddenly. I am unable to find the reason.</p>
  
  <p>Here is a sample of the code in use:</p>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>        [DisplayName("Select file(s) to upload")]
          [Required(ErrorMessage = "Select atleast one file")]
          public HttpPostedFileBase File { get; set; }
          [Required]
          [StringLength(250, MinimumLength = 3)]
          public string Comments { get; set; }
  </code></pre>
  
  <p><strong>View:</strong> </p>
  
  <pre><code>    &lt;div class="form-group"&gt;
          @Html.LabelFor(model =&gt; model.File, new { @class = "control-label col-md-2" })
          &lt;div class="col-md-10"&gt;
              @Html.TextBoxFor(model =&gt; model.File, new { type = "file"})
              @Html.ValidationMessageFor(model =&gt; model.File)
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br /&gt;
  &lt;div class="form-group"&gt;
      @Html.LabelFor(model =&gt; model.Comments, new { @class = "control-label col-md-2" })
      &lt;div class="col-md-10"&gt;
          @Html.TextAreaFor(model =&gt; model.Comments)
          @Html.ValidationMessageFor(model =&gt; model.Comments)
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>jQuery files in generated HTML</strong></p>
  
  <pre><code>&lt;script src="/Scripts/jquery-1.8.2.js"&gt;&lt;/script&gt;
  &lt;script src="/Scripts/jquery.mobile-1.2.0.js"&gt;&lt;/script&gt;  
  &lt;script src="/Scripts/jquery.unobtrusive-ajax.js"&gt;&lt;/script&gt;
  &lt;script src="/Scripts/jquery.validate.js"&gt;&lt;/script&gt;
  &lt;script src="/Scripts/jquery.validate.unobtrusive.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Whenever I submit the form it always go to controller instead of performing client side validation and showing error messages.
  Why?</p>