Finding the referring url that brought a user to m

2020-05-06 08:23发布

问题:

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?

回答1:

Request.UrlReferrer

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



回答2:

Request.UrlReferrer can be used to retrieve the previous page url from where the current page has been redirected.



回答3:

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



回答4:

Request.UrlReferrer

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



回答5:

HttpContext.Current.Request.UrlReferrer


标签: c# asp.net