title: ASP.NET MVC 4 Default _LoginPartial template Logout not working
body: <p>I have been fiddling around with the _Layout and _PartialLayouts of the default MVC 4 templates and suddenly the 'Logout' feature in the '_PartialLogin' doc has stopeed working. To give you more info, the _LoginPartial.cshtml is called from the _NavBar.cshtml which in turn is called from the _Layout.cshtml</p>
  
  <p>The code of the _LoginPartial.cshtml is:</p>
  
  <pre><code>@if (Request.IsAuthenticated) {
  &lt;text&gt;
      &lt;p&gt;Hello, @Html.ActionLink(User.Identity.Name, "Manage", "Account", routeValues: null, htmlAttributes: new { @class = "username", title = "Manage" })!
      @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" })) {
          @Html.AntiForgeryToken()
          &lt;a href="javascript:document.getElementById('logoutForm').submit()"&gt;Log off&lt;/a&gt;
      }&lt;/p&gt;
  &lt;/text&gt;
  } 
  </code></pre>
  
  <p>The code from the _NavBar.cshtml is:</p>
  
  <pre><code>&lt;form class ="navbar-form navbar-right" method="post" action="/account/login"&gt;
      &lt;div class ="form-group"&gt;
          @Html.Partial("_LoginPartial")
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The code from the _Layout.cshtml is:</p>
  
  <pre><code>&lt;body&gt;
      @Html.Partial("_Navbar")
      @RenderSection("featured", required: false)
      @RenderBody()
      &lt;div class="container"&gt;
  </code></pre>
  
  <p>I get that maybe the problem is the javascript has been disabled unintentionally somehow. Am I missing some script tags maybe? Or is it something in the previous class where I called the _PartialLogin from??</p>