title: partial view login on home page
body: <p>This question has been asked many times but I don't think the way I need it.</p>
  
  <p>I'm trying to implement a login form on the home page but this form is located in a section that pops up, like you have on this site: <a href="http://myanimelist.net" rel="nofollow">http://myanimelist.net</a>.</p>
  
  <p>I've created a <strong>partial view</strong> for my login form:</p>
  
  <pre><code>@model ArtWebShop.Models.customers
  
  @section Validation {
      @Scripts.Render("~/bundles/jqueryval")
  }
  
  &lt;section id="login"&gt;
  
      @using (Html.BeginForm("LoginValidate", "Login", FormMethod.Post, new { enctype = "multipart/form-data" }))
      {
          @Html.ValidationSummary(true)
          @Html.ValidationSummary()
          &lt;fieldset&gt;
              &lt;legend&gt;Login&lt;/legend&gt;
  
              @Html.LabelFor(model =&gt; model.email)
              @Html.TextBoxFor(m =&gt; m.email) 
  
              @Html.LabelFor(m =&gt; m.password)
              @Html.PasswordFor(m =&gt; m.password)
  
              &lt;input type="submit" value="Login" class="button" /&gt;
          &lt;/fieldset&gt;
      }
  
  &lt;/section&gt;
  </code></pre>
  
  <p>This is shown on the <strong>home page (index.cshtml)</strong>:</p>
  
  <pre><code>&lt;section class="shown"&gt;
      @Html.Partial("_LoginPartial")
      @Html.ValidationSummary(true)
      @Html.ValidationSummary()
  &lt;/section&gt;
  </code></pre>
  
  <p>The partial view is shown correctly.
  But now comes the part that doesn't work. </p>
  
  <p>When you press login if you haven't filled in the fields, the validation is done in my LoginController as it should but I can't seem the send the errors to my home page view when I redirect.</p>
  
  <pre><code>    [HttpPost]
      public ActionResult LoginValidate(string redirect)
      {
          if (_unitOfWork.CustomersRepository.CostumerIsValid(Request.Form["email"], Request.Form["password"]))
          {
              if (!String.IsNullOrEmpty(redirect) || String.Compare(redirect, "none", StringComparison.OrdinalIgnoreCase) == 0)
              {
                  if (redirect != null) Response.Redirect(redirect, true);
              }
              else
              {
                  return RedirectToAction("index", "Home");
              }
          }
          ModelState.AddModelError("email", "You entered an incorrect email address");
          ModelState.AddModelError("password", "You entered an invalid password");
  
          return RedirectToAction("index", "Home");
      }
  </code></pre>
  
  <p>That's my loginValidation. Since nothing is filled in the errors are added to the ModelState and then it redirects to the home page. This however doesn't shows me the errors.I'm guessing it's exactly because I redirect but how can I solve this? </p>