title: How to use Request.UrlReferrer in ASP.NET?
body: <p>I have two aspx web pages. In the first one I have this code: </p>
  
  <pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      Response.Redirect("~/Code.aspx")
  End Sub
  </code></pre>
  
  <p>Now in the Code.aspx page I have this code:</p>
  
  <pre><code>Label1.Text = Request.UrlReferrer.ToString
  </code></pre>
  
  <p>I want the label show the first page URl, but there is a runtime ERROR.How to fix this? thanks</p>
  
  <p>This is the error message: <code>Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.</code></p>