That works! Thanks.
>>> How can I get the url of the web page that called my page? This may be
>>> from
[quoted text clipped - 6 lines]
>>
>> Try Request.UrlReferrer
> That works! Thanks.
Be aware, though, that you can't rely on this, as more and more ISPs are
stripping HTTP_REFERER from headers...

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Alexey Smirnov - 02 Oct 2007 08:04 GMT
> >>> How can I get the url of the web page that called my page? This may be
> >>> from
[quoted text clipped - 14 lines]
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net
Mark is right, you have to check if (Request.UrlReferrer != null), for
example:
if (Request.UrlReferrer==null) {
// user typed in an URL directly, or used a bookmark
} else {
// user came from other website
}
George Ter-Saakov - 02 Oct 2007 14:15 GMT
Actually, from my "vast" experience
do not use Request.UrlReferrer
instead use Request.ServerVariables["HTTP_REFERER"]
the reason is that UrlReferrer is returning object Uri and it will throw
exception if passed referrer is in incorrect format.
So either be ready that code
if (Request.UrlReferrer != null)
can throw exception or use Request.ServerVariables["HTTP_REFERER"].
It always returns string and usually you do not need to know if it's a valid
http reference or not.
You should check for null anyway.
George.
>> >>> How can I get the url of the web page that called my page? This may
>> >>> be
[quoted text clipped - 25 lines]
> // user came from other website
> }