title: Ajax.BeginForm replaces whole page with partial view
body: <p>I'm having problems using <code>Ajax.BeginForm()</code> in my simple ASP.NET MVC application. I've searched SO for solution but nothing I found seems to help.  </p>
  
  <p>I've created a new project using the default Visual Studio 2015 template. I've changed the <code>Index.cshtml</code> file to:</p>
  
  <pre><code>@{
      ViewBag.Title = "Home Page";
  }
  
  &lt;div class="jumbotron"&gt;
      &lt;h1&gt;ASP.NET&lt;/h1&gt;
      &lt;p class="lead"&gt;ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.&lt;/p&gt;
      &lt;p&gt;&lt;a href="http://asp.net" class="btn btn-primary btn-lg"&gt;Learn more &amp;raquo;&lt;/a&gt;&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;div id="ajax-test"&gt;&lt;/div&gt;
  
      @using (Ajax.BeginForm("Test", new AjaxOptions()
      {
          UpdateTargetId = "ajax-test",
          InsertionMode = InsertionMode.Replace
      }))
      {
          &lt;input type="submit" /&gt;
      }
  &lt;/div&gt;
  </code></pre>
  
  <p>I've added a new action to <code>HomeController</code>:</p>
  
  <pre><code>    public ActionResult Test()
      {
          return PartialView("Test");
      }
  </code></pre>
  
  <p>A new view <code>Home\Test.cshtml</code>:</p>
  
  <pre><code>Hello world
  </code></pre>
  
  <p>And, crucially, I've added a reference to the required JavaScript files to <code>_Layout.cshtml</code> (moving them to the top of the page doesn't help).</p>
  
  <pre><code>    ...
      @Scripts.Render("~/bundles/jquery")
      @Scripts.Render("~/bundles/jqueryval")
      @Scripts.Render("~/bundles/bootstrap")
      @RenderSection("scripts", required: false)
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I've verified the <code>jqueryval</code> bundle renders in the debug mode as:</p>
  
  <pre><code>&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>These entries were already present in <code>web.config</code> file:</p>
  
  <pre><code>&lt;add key="ClientValidationEnabled" value="true" /&gt;
  &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
  </code></pre>
  
  <p>I would expect that when I press Submit, the div will be populated with 'Hello world'. Instead, the whole page is replaced with 'Hello world' and the browser is redirected to <code>/Home/Test</code>. No errors reported in developer tools.</p>
  
  <p>What element of the puzzle is missing? I know similar questions have been asked on StackOverflow before but the usual answer was to include these JavaScript files, which I did. Above are all the changes I've done to the template project so I can't see what I could break.</p>