title: Ajax.BeginForm driving me crazy
body: <h2>ASP.NET MVC3</h2>
  
  <p>I have a partial view that is initially rendered inside a div. The following is the partial code:</p>
  
  <pre><code>@model Venue.Models.Validation.CustomerRequestModel
  
  &lt;script src="@Url.Content("~/Scripts/jquery-1.4.4.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 type="text/javascript" src="/Scripts/MicrosoftAjax.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/Scripts/MicrosoftMvcAjax.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/Scripts/MicrosoftMvcValidation.js"&gt;&lt;/script&gt;
  
  @{ Html.RenderPartial("Message"); }
  @Html.ValidationSummary()
  
  @using (Ajax.BeginForm(
              "Customer",
              "Service",
              null,
              new AjaxOptions()
              {
                  HttpMethod = "post",
                  InsertionMode = InsertionMode.Replace,
                  LoadingElementDuration = 100,
                  LoadingElementId = "loading-customer",
                  OnBegin = "hideSubmitButton",
                  OnSuccess = "hideForm",
                  OnComplete = "showSubmitButton",
                  OnFailure = "showErrorMessage",
                  UpdateTargetId = "formclientes",
              },
              new
              {
                  id = "customer-form"
              }))
  {
      // Fields are all type="text" although some are numbers.
      &lt;input type="text" name="Address" class="clientes_form" /&gt;
  }
  </code></pre>
  
  <p>The action:</p>
  
  <pre><code>[AcceptVerbs(HttpVerbs.Post)]
  public ActionResult Customer(CustomerRequestModel customer)
  {
    // ...
  }
  </code></pre>
  
  <p>In the immediate window, this is what I get:</p>
  
  <pre><code>this.Request.IsAjaxRequest()
  false
  </code></pre>
  
  <p>Why?!</p>