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?
Finding previous page Url
How do I find the referring url that brought a user to my site in ASP.NET?
How can I find what search terms (if any) brought a user to my site?
Request.UrlReferrer
But this isn't guaranteed to be correct or even exist.
Request.UrlReferrer can be used to retrieve the previous page url from where the current page has been redirected.
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
Request.UrlReferrer
http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer.aspx
HttpContext.Current.Request.UrlReferrer