title: login in partial view is not working
body: <p>I am trying to create a login on a partial view without the need to refresh the whole browser when someone logs in.</p>
  
  <p>The login controller works perfectly and also it selects ok the partial View that it has to be shown later. The problem is that this partial View doesn't detect that the user is logged. </p>
  
  <p>If I refresh the web (F5) I can see the user is, as I said, well logged.</p>
  
  <p>Controler:</p>
  
  <pre><code>[AllowAnonymous]
  public ActionResult Login() {
      return PartialView("_Login");
  }
  
  [HttpPost]
  [AllowAnonymous]
  [ValidateAntiForgeryToken]
  public ActionResult Login(LoginModel model, string returnUrl) {
      if(ModelState.IsValid) {               
          if(WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe.Value)) {
              return PartialView("LogOnPartialView", "Shared");                    
          }
          ModelState.AddModelError("", "The user name or password provided is incorrect.");
      }
      return View(model);
  }
  </code></pre>
  
  <p>Partial View _login</p>
  
  <pre><code>@using (Ajax.BeginForm("Login", "Account", new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "loginControl" }))
  {
      @Html.AntiForgeryToken()
  
      &lt;div class="form-field"&gt;
          @Html.EditorFor(m =&gt; m.UserName)
          @Html.ValidationMessageFor(m =&gt; m.UserName)
      &lt;/div&gt;
  
      &lt;div class="form-field"&gt;
          @Html.EditorFor(m =&gt; m.Password)
          @Html.ValidationMessageFor(m =&gt; m.Password)
      &lt;/div&gt;
  
        &lt;input type="submit" value="Login" /&gt;
  }
  </code></pre>
  
  <p>Partial View LogOnPartialView</p>
  
  <pre><code>@if (HttpContext.Current.User.Identity.IsAuthenticated)
  {
    &lt;div&gt;user is logged&lt;/div&gt;
  }
  else
  {
      &lt;div&gt;user is NOT logged&lt;/div&gt;
  }
  
  @if(!Request.IsAuthenticated) 
  {
      @Html.ActionLink("Registro", "Register", "Account") 
      @: | 
      @Ajax.ActionLink("Login", "Login", "Account", new AjaxOptions { UpdateTargetId = "Login" })
  }
  else 
  {
      @: Welcome &lt;b&gt;@User.Identity.Name&lt;/b&gt;!
  
      @: |
      @Html.ActionLink("Logout", "LogOff", "Account")
  }
  </code></pre>
  
  <p>Could anyone help me with this, please?</p>