asp.netpathhttprequesthttpapplication

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 ?


Solution

  • 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.