tags:

views:

176

answers:

4

Duplicate:

Finding previous page Url


How do I find the referring url that brought a user to my site in ASP.NET?


See Also:

How can I find what search terms (if any) brought a user to my site?

+3  A: 
Request.UrlReferrer

But this isn't guaranteed to be correct or even exist.

David
A: 

HttpContext.Current.Request.UrlReferrer

jellomonkey
A: 

The referer URL should be in the HTTP headers on the request.

E.g. Uri MyUrl = Request.UrlReferrer

See: http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer.aspx

Steve Haigh