title: How change the content with ajax.BeginForm?
body: <p>First, sorry for my bad english.</p>
  
  <p>I would like when one people click on the button "Page1", the controller return a renderpartial of the "Page1" and the same things for "page2" and "allPage".</p>
  
  <p>My views is:</p>
  
  <pre><code>@{
  ViewBag.Title = "Title";
  }
  &lt;script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;h2&gt;Title&lt;/h2&gt;
  
  @using (Ajax.BeginForm("NameAction", //controller action name
  "NameController", //controller name
  new AjaxOptions //ajax options that tell mvc how to perform the replacement
  {
  UpdateTargetId = "ViewPage", //id of div to update
  HttpMethod = "Post" //how to call the controller action
  }, new { id = "FormName" }))
  {
  &lt;input type="submit" id="btn" value="p1" id="p1"/&gt;
  &lt;input type="submit" id="btn" value="p2" id="p2"/&gt;
  &lt;input type="submit" id="btn" value="AllPage" id="AllPage"/&gt;
  &lt;div id="ViewPage"&gt;
      //render partial view
  &lt;/div&gt;        
  }
  </code></pre>
  
  <p>And my controller is:</p>
  
  <pre><code>public class NameController : Controller
  {
      [HttpPost]
      public ActionResult NameAction(String btn)
      {
          if (Request.IsAjaxRequest())
          if(btn="p1")
          return PartialView("p1");
          if(btn="2")
          return PartialView("p2");
          if(btn="3")
          return PartialView("p3");
  
  
          return View();
      }
  }
  </code></pre>
  
  <p>Request.isAjaxRequest equals always false and the partialview not update the div but erase all page</p>
  
  <p>Thanks for your helps.</p>