title: client side validation not working for mvc 4
body: <p>For some reason, i have this same code validating properly in mvc 3, but in mvc 4 client side validation is never being called. Essentially, i need the client-side validation to work inside the jquery modal dialog. Any thoughts as to why the client-side validation is not being called?</p>
  
  <p><strong>Web.config</strong></p>
  
  <pre><code>&lt;appSettings&gt;
     &lt;add key="webpages:Version" value="2.0.0.0" /&gt;
     &lt;add key="webpages:Enabled" value="false" /&gt;
     &lt;add key="PreserveLoginUrl" value="true" /&gt;
     &lt;add key="ClientValidationEnabled" value="true" /&gt;
     &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
  &lt;/appSettings&gt;
  </code></pre>
  
  <p><strong>code calling the jquery dialog box</strong></p>
  
  <pre><code>&lt;script src="@Url.Content("~/Scripts/jquery-1.8.3.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery-ui-1.9.2.custom.min.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;
  &lt;script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;script&gt;
      $(document).ready(function () {
          $('#lnk_report').click(function () {
              $('#dialog_report').dialog('open');
  
          });
  
          $.validator.unobtrusive.parse('#dialog_report');
          $('#dialog_report').dialog({
              position: {
                  my: "center",
                  at: "center",
              },
              autoOpen: false,
              width: 800,
              resizable: true,
              title: 'Report',
              modal: true,
              open: function (event, ui) {
                  $(this).load('@Url.Action("CreateReport")');
              },
              buttons: {
                  "Cancel": function () {
                      $(this).dialog("close");
                  },
                  "Submit": function () {
                      if ($('form').validate().form()) {
                          $.ajax({
                              url: '@Url.Action("CreateReport")',
                              type: 'POST',
                              data: $("form").serialize(),
                              success: function (result) {
                                  $('#dialog_report').dialog("close");
                              }
                          });
                      }
                  }
              }
          });
  
  
      });
  &lt;/script&gt;
  
  
  @section featured {
      &lt;section class="featured"&gt;
          &lt;div class="content-wrapper"&gt;
              &lt;hgroup class="title"&gt;
                  &lt;h1&gt;@ViewBag.Title.&lt;/h1&gt;
                  &lt;h2&gt;@ViewBag.Message&lt;/h2&gt;
              &lt;/hgroup&gt;
          &lt;/div&gt;
      &lt;/section&gt;
  }
  
   &lt;a id="lnk_report"&gt;Monthly Report&lt;/a&gt;
   &lt;div id="dialog_report" title="Report" style="overflow: hidden;"&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>code for dialog box</strong></p>
  
  <pre><code>@model DefaultMvc4App.Models.ReportModel
  
  &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;
  
  @using (Html.BeginForm()) {
      @Html.ValidationSummary(true)
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;@Html.LabelFor(model =&gt; model.Month)&lt;/td&gt;
              &lt;td&gt;@Html.DropDownListFor(model =&gt; model.Month, Model.AllMonths, "-- Select Month --")&lt;/td&gt;
              &lt;td&gt;@Html.ValidationMessageFor(model =&gt; model.Month)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;@Html.LabelFor(model =&gt; model.Year)&lt;/td&gt;
              &lt;td&gt;@Html.DropDownListFor(model =&gt; model.Year, Model.AllYears, "-- Select Year --")&lt;/td&gt;
              &lt;td&gt;@Html.ValidationMessageFor(model =&gt; model.Year)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;@Html.LabelFor(model =&gt; model.GeneralMeeting)&lt;/td&gt;
              &lt;td&gt;@Html.DropDownListFor(model =&gt; model.GeneralMeeting, Model.YesNo, "-- Select Answer --")&lt;/td&gt;
              &lt;td&gt;@Html.ValidationMessageFor(model =&gt; model.GeneralMeeting)&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  }
  </code></pre>
  
  <p><strong>ReportModel</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel.DataAnnotations;
  using System.ComponentModel.DataAnnotations.Schema;
  using System.Data.Entity;
  using System.Globalization;
  using System.Web.Mvc;
  using System.Web.Security;
  
  namespace DefaultMvc4App.Models {
      public class ReportModel {
          [Key]
          public Guid ReportID { get; set; }
  
          [Required]
          public string Month { get; set; }
          public IEnumerable&lt;SelectListItem&gt; AllMonths {
              get { return new SelectList(Utils.GetMonths()); }
          }
  
          [Required]
          public string Year { get; set; }
          public IEnumerable&lt;SelectListItem&gt; AllYears {
              get { return new SelectList(Utils.GetYears()); }
          }
  
          [Required]
          public string GeneralMeeting { get; set; }
          public IEnumerable&lt;SelectListItem&gt; YesNo {
              get { return new SelectList(Utils.GetYesNo()); }
          }
      }
  }
  </code></pre>
  
  <p><strong>Controller Code</strong></p>
  
  <pre><code>    [HttpPost]
      public ActionResult CreateReport(ReportModel report) {
          if (ModelState.IsValid) {
              try {
                  report.ReportID = Guid.NewGuid();
                  db.report.Add(report);
                  db.SaveChanges();
                  return Json(new { success = true });
              }
              catch (Exception e) {
                  return Json(new { success = false });
              }
          }
          return Json(new { success = false });
      }
  </code></pre>