HttpContext and Source Page

  • Thread starter Thread starter Paul Cheetham
  • Start date Start date
P

Paul Cheetham

Hi,

I have some custom error pages, and in them I examine the
HttpContext.Current object to get information about what was happening
at the time.

Is it possible to find out from which page the user has been directed?
e.g. if I capture a 404 - page not found error, I can find the url of
the missing page, but is there a way of finding out which page the
faulty link / redirect is located on?


Thankyou.


Paul
 
Thanks very much.


Paul


Request.UrlReferrer will give the full path of the page that the faulty link
was on.

So, if your 404 redirect page is 404Handler.aspx and Page1.aspx has a link
to non-existent page Nonexistent.aspx cliking on this link in page1.aspx will
give (assuming all pages are in root folder)

http://servername/website/page1.aspx for the Request.UrlReferrer in
404Handler.aspx

- eeraj
=====
http://www.interviewboard.com
.NET, SQL, C#, Oracle - interview questions
 
Back
Top