Forum Moderators: open
Can someone please post the code to bring back the referrer. Every time I try it I get the 'Object reference not set to an instance of an object'.
FYI,
I have tried the following:
1. Referrer = Request.UrlReferrer.AbsolutePath.ToString
2. Referrer = Request.ServerVariables("http_referrer")
3. Referrer = Request.UrlReferrer.ToString()
Can you please include any needed namespaces.
Thanks in advanced
Chris 'losing my mind' Felstead.
The Page class defines Request and provides it to your page. If you haven't inherited from System.Web.UI.Page, then Request won't be defined.
System.Web.UI.Page is already inherited in my code. Here's the code if it help. Boy am I owing you guys a few favor's. This is the last problem though, I PROMISE.
Dim Referrer As StringReferrer = Request.UrlReferrer.AbsolutePath.ToString
Response.Write(Referrer)
error message
Dim Referrer As StringReferrer = Request.ServerVariables("http_referrer")
Response.Write(Referrer)
Returns a blank page
Dim Referrer As StringReferrer = Request.UrlReferrer.ToString()
Response.Write(Referrer)
error message
Thanks again.
Chris.