title: Checking Request.IsAjaxRequest always return false inside my asp.net mvc4
body: <p>I have the following code inside my controller</p>
  
  <pre><code>public ActionResult Index(string searchTerm=null)
          {   System.Threading.Thread.Sleep(5000);
              var accountdefinition = repository.FindAccountDefinition(searchTerm).ToList();
              if (Request.IsAjaxRequest())
              { return PartialView("_CustomerTable",accountdefinition); }
          return View(accountdefinition);         
          }
  </code></pre>
  
  <p>But if I call the above action method using an Ajax.beginform,, then the Request.IsAjaxRequest will return false and the partial view will not be returned</p>
  
  <pre><code>@using (Ajax.BeginForm(
  new AjaxOptions{
      HttpMethod= "get",
      InsertionMode=InsertionMode.Replace,
      LoadingElementId = "progress",
      UpdateTargetId="customerTable"}))
      {
  &lt;div style="float:right"&gt;Search &lt;input placeholder="Search by name.." name="searchTerm" type="text"&gt; &lt;input class="btn btn-success" type="submit" value="search" /&gt;&lt;/div&gt;               
  
  }
  &lt;div id = "progress" class="loadingimage"&gt;
  &lt;img src="~/Content/Ajax-loader-bar.gif" /&gt;
  &lt;/div&gt;
  </code></pre>