HttpContext and Source Page

Discussion in 'ASP .Net' started by Paul Cheetham, Dec 1, 2006.

  1. 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
    Paul Cheetham, Dec 1, 2006
    #1
    1. Advertising

  2. Thanks very much.


    Paul



    Eeraj wrote:
    > 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
    >
    >
    > "Paul Cheetham" wrote:
    >
    >> 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
    >>
    Paul Cheetham, Dec 4, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DesignerX

    Page.Cache vs HttpContext.Current.Cache

    DesignerX, Jan 20, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    8,227
    vMike
    Jan 20, 2004
  2. HaukiDog
    Replies:
    0
    Views:
    460
    HaukiDog
    Mar 7, 2004
  3. sripathi
    Replies:
    0
    Views:
    1,226
    sripathi
    Dec 31, 2009
  4. Ali Khawaja
    Replies:
    1
    Views:
    156
  5. Tony

    Dim context As HttpContext = HttpContext.Current

    Tony, Mar 2, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    298
    Teemu Keiski
    Mar 3, 2004
Loading...

Share This Page