title: Url skip second querystring parameter in HttpContext.Current.Request.Url.AbsoluteUri
body: <p>I have a class which i inherit to all pages to check if session  timeouts then redirect to login page here is the code</p>
  
  <pre><code>public class WMUserBase:System.Web.UI.Page
  {
      public WMUserBase()
      {
  
      }
      protected override void OnLoad(System.EventArgs e)
      {
          CheckSecurity();
          base.OnLoad(e);
      }
      public virtual void CheckSecurity()
      {
          if (Session["WMuserId"] == null || Session["WMuserId"].ToString() == "")
          {
              Response.Redirect("Login.aspx?ReturnUrl=" + HttpContext.Current.Request.Url.AbsoluteUri);
          }
      }
  }
  </code></pre>
  
  <p>Every page inherit this class and if session timeouts then page is redirected to login page now i used <br> <code>Response.Redirect("Login.aspx?ReturnUrl=" + HttpContext.Current.Request.Url.AbsoluteUri);</code>
   but if my querystring has two parameters for eg <code>http://localhost/mala3ibnav2/WeeklyManager/TeamSetup.aspx?Gid=MTQ=&amp;Mid=Mg==</code>
   in AbsoluteUril <strong>&amp;Mid=Mg==</strong> is sometimes skipped not always.<br>
  Here is the code for Login Page login button click event</p>
  
  <pre><code> if(string.IsNullOrEmpty(ReturnUrl))
                  {
                      Response.Redirect("Default.aspx");
                  }
                  else
                  {
                      Response.Redirect(ReturnUrl);
                  }
  </code></pre>
  
  <p>Now why second parameter is skipped in querystring and what else should I is use instead of HttpContext.Current.Request.Url.AbsoluteUri</p>