title: Submit button in partialview return result without layout
body: <p>I have a shared layout with partialView for login in it.
  If login process succeeded it redirect to main page and everything works, but if login failed,
  It returns only the partial view with the errors without the shared layout.</p>
  
  <p>The result is a page with this url : <code>localhost:35967/Account/Login</code> with only the partialview contains the validation summary errors.</p>
  
  <p>How to fix it ?</p>
  
  <p>Here is my code:</p>
  
  <p>AccountController.cs</p>
  
  <pre><code>    [HttpGet]
      public ActionResult Login()
      {
          return PartialView();
      }
  
      [AllowAnonymous]
      [HttpPost]
      public ActionResult Login(LoginModel login,string returnUrl)
      {
          if (ModelState.IsValid)
          {
              if (ValidateUser(login))
              {
                  FormsAuthentication.SetAuthCookie(login.Username, false);
                  return Redirect(returnUrl ?? Url.Action("Index", "Home"));
              }
  
              ModelState.AddModelError("", "User not found");
          }
  
          return PartialView(login);
      }
  </code></pre>
  
  <p>Login.cshtml</p>
  
  <pre><code>@model DesignCrafts.MVC.Models.LoginModel
  @using (Html.BeginForm("Login", "Account", FormMethod.Post, new { id = "login", @class = "enter_form" }))
  {
  &lt;span style="color:red"&gt;@Html.ValidationSummary(true, "Login failed")&lt;/span&gt;
  
      @Html.TextBoxFor(model =&gt; model.Username, new { @placeholder = "username" })
      @Html.ValidationMessageFor(model =&gt; model.Username)
  
      @Html.PasswordFor(model =&gt; model.Password, new { @placeholder = "password" })
      @Html.ValidationMessageFor(model =&gt; model.Password)
  
      &lt;input type="submit" value="login" class="btn" /&gt;
  
      &lt;span style="margin-right:5px"&gt;
          @Html.ActionLink("register", "Register", "Account", new { @class = "white-link"})
      &lt;/span&gt;
      @Html.ValidationSummary(true, "user not found")
  
  }
  </code></pre>
  
  <p>_Layout.cshtml</p>
  
  <pre><code>     @if (Request.IsAuthenticated)
       {
          &lt;div class="enter"&gt;
          &lt;div&gt;
          Logged as: @User.Identity.Name
          &lt;/div&gt;
          @Html.ActionLink("Log out", "Logoff", "Account", null, new { @class = "exit" })
          &lt;/div&gt;
        }
       else
        {
            { Html.RenderAction("Login", "Account"); }
        }
  </code></pre>