title: Request.UrlReferrer null?
body: <p>In an aspx C#.NET page (I am running framework v3.5), I need to know where the user came from since they cannot view pages without logging in.  If I have page <code>A</code> (the page the user wants to view) redirect to page <code>B</code> (the login page), the Request.UrlReferrer object is null.  </p>
  
  <p>Background: If a user isn't logged in, I redirect to the Login page (<code>B</code> in this scenario).  After login, I would like to return them to the page they were requesting before they were forced to log in.</p>
  
  <p><strong>UPDATE:</strong> 
  <br />A nice quick solution seems to be:
  <br /><code>//if user not logged in 
  Response.Redirect("..MyLoginPage.aspx?returnUrl=" + Request.ServerVariables["SCRIPT_NAME"]);</code>
  <br />Then, just look at QueryString on login page you forced them to and put the user where they were after successful login.</p>