简体   繁体   中英

HttpApplication and the current page

As we all know the HttpApplication object holds objects regarding the requested page (HttpRequest) and the page where we are supposed to be redirected (HttpResponse); I need to get the url of the page which requested the page; how could I get it from the HttpApplication ?

You want to check the url referrer header like so:

string MyReferrer = Request.UrlReferrer.ToString();

This value is set by the browser however - so can't exactly be trusted from a security viewpoint.

您需要使用HttpRequest.UrlReferrer属性,请参见-http: //msdn.microsoft.com/zh-cn/library/system.web.httprequest.urlreferrer.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM