title: return url is not working after login
body: <p>I am working on asp.net MVC 3 application. One home page of the application, there are some links which redirect to login page like this:</p>
  
  <pre><code> &lt;a href="Home/Login?returnUrl=/Disputes/Index"&gt; Disputes &lt;/a&gt;
  </code></pre>
  
  <p>login action method is like this:</p>
  
  <pre><code>  public ActionResult Login() 
          {
  return view();
          }
  </code></pre>
  
  <p>on Login view I have a partial view like this:</p>
  
  <pre><code> @Html.Partial("_LogOn", new LogOnModel { Type = LogOnTypeEnum.Obligor })
  </code></pre>
  
  <p>and _LogOn partial is like this:</p>
  
  <p>at the top it is like this:</p>
  
  <pre><code>@{
      string retUrl = "";
      if (ViewContext.HttpContext.Request.UrlReferrer != null)
      {
          retUrl =
            ViewContext.HttpContext.Request.UrlReferrer.PathAndQuery;
      }             
  }
  </code></pre>
  
  <p>and form looks like this:</p>
  
  <pre><code>@using (Html.BeginForm("LogOn", "Account", FormMethod.Post, new { autocomplete = "off", id = "frmLogin", Type = 2, model = this.Model, returnUrl = Request.QueryString["ReturnUrl"] }))
  </code></pre>
  
  <p>and finally logon method of Account controller:</p>
  
  <pre><code> public ActionResult LogOn(LogOnModel model, string returnUrl)
  
  {
  // I want to redirect to localhost:2304//myapp/returnurl but returnurl is empty
  
  }
  </code></pre>
  
  <p>I am following this example ( it is not using partial view as I am using)</p>
  
  <p><a href="http://visualstudiounleashed.com/mikesnell/post/2011/08/16/Using-the-ASPNET-MVC-3-Logon-returnUrl-Parameter.aspx" rel="nofollow">http://visualstudiounleashed.com/mikesnell/post/2011/08/16/Using-the-ASPNET-MVC-3-Logon-returnUrl-Parameter.aspx</a></p>