HttpContext and Source Page

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
 
P

Paul Cheetham

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top