Forum Moderators: open
My code simply reads
Dim PageReferrer As String
PageReferrer = Request.UrlReferrer.ToString
This works fine if there is a referrer. However, if there is no referrer I get the following error message.
Object reference not set to an instance of an object.
I have tried several ways of fixing this including:
Dim PageReferrer As String
If Request.UrlReferrer.ToString Is Null Then
PageReferrer = "NULL"
Else
PageReferrer = Request.UrlReferrer.ToString
End If
The problem with this is that 'Is Null' is no longer used. Can someone help me find a way around this please. I am using VB.net to build an ASP.net web application.
Don't you just love me Xoc. I promise this is the last time ;)
Thanks In Advanced
Chris.