Dharma Dude
Dharma Dude

Reputation: 559

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 ?

Upvotes: 0

Views: 899

Answers (2)

Barry Kaye
Barry Kaye

Reputation: 7759

You need to use the HttpRequest.UrlReferrer property see - http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer.aspx

Upvotes: 0

m.edmondson
m.edmondson

Reputation: 30922

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.

Upvotes: 2

Related Questions