How to determine when a page is being redirected

Discussion in 'ASP .Net' started by =?Utf-8?B?T3Bh?=, Oct 5, 2006.

  1. Hi,

    I would like to know if there is an event that will tell me when a page is
    being redirected and also the url of where the page is being redirected.
    Is there an event that is fired which will give me this information.

    Note: I want to use this event to remove a session variable.

    Thanks in advance
     
    =?Utf-8?B?T3Bh?=, Oct 5, 2006
    #1
    1. Advertising

  2. if not Page.isPostBack then
    ' the page came from a link, not from a Postback in the same page
    end if


    to see what was the previous page link, just use session variables
    ( http://www.filtrarte.com/sessions.asp )
    the PATH_INFO give's you the page, just have a session called
    session("PageInfo") and set it in the Master page
    like session("PageInfo") = request.serverVariables("PATH_INFO")

    then when you get inside the not Page.isPostBack if
    you can always see if that session has something and what it is
    if is nothing then the user reach there for the first time (external link)
    else the user came from your website and you know from witch page

    hope it helps

    --

    Bruno Alexandre
    København, Danmark

    "a portuguese in Denmark"


    "Opa" <> escreveu na mensagem
    news:...
    > Hi,
    >
    > I would like to know if there is an event that will tell me when a page is
    > being redirected and also the url of where the page is being redirected.
    > Is there an event that is fired which will give me this information.
    >
    > Note: I want to use this event to remove a session variable.
    >
    > Thanks in advance
     
    Bruno Alexandre, Oct 5, 2006
    #2
    1. Advertising

  3. Yes, I know about IsPostBack,
    but I want to know when a page is Unloaded
    or "being" redirected to another page.

    How do I check for this?

    "Bruno Alexandre" wrote:

    >
    >
    > if not Page.isPostBack then
    > ' the page came from a link, not from a Postback in the same page
    > end if
    >
    >
    > to see what was the previous page link, just use session variables
    > ( http://www.filtrarte.com/sessions.asp )
    > the PATH_INFO give's you the page, just have a session called
    > session("PageInfo") and set it in the Master page
    > like session("PageInfo") = request.serverVariables("PATH_INFO")
    >
    > then when you get inside the not Page.isPostBack if
    > you can always see if that session has something and what it is
    > if is nothing then the user reach there for the first time (external link)
    > else the user came from your website and you know from witch page
    >
    > hope it helps
    >
    > --
    >
    > Bruno Alexandre
    > København, Danmark
    >
    > "a portuguese in Denmark"
    >
    >
    > "Opa" <> escreveu na mensagem
    > news:...
    > > Hi,
    > >
    > > I would like to know if there is an event that will tell me when a page is
    > > being redirected and also the url of where the page is being redirected.
    > > Is there an event that is fired which will give me this information.
    > >
    > > Note: I want to use this event to remove a session variable.
    > >
    > > Thanks in advance

    >
    >
    >
     
    =?Utf-8?B?T3Bh?=, Oct 5, 2006
    #3
  4. the same thing applies !

    Protected Sub Page_Unload(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles Me.Unload

    End Sub


    --

    Bruno Alexandre
    København, Danmark

    "a portuguese in Denmark"


    "Opa" <> escreveu na mensagem
    news:...
    > Yes, I know about IsPostBack,
    > but I want to know when a page is Unloaded
    > or "being" redirected to another page.
    >
    > How do I check for this?
    >
    > "Bruno Alexandre" wrote:
    >
    >>
    >>
    >> if not Page.isPostBack then
    >> ' the page came from a link, not from a Postback in the same page
    >> end if
    >>
    >>
    >> to see what was the previous page link, just use session variables
    >> ( http://www.filtrarte.com/sessions.asp )
    >> the PATH_INFO give's you the page, just have a session called
    >> session("PageInfo") and set it in the Master page
    >> like session("PageInfo") = request.serverVariables("PATH_INFO")
    >>
    >> then when you get inside the not Page.isPostBack if
    >> you can always see if that session has something and what it is
    >> if is nothing then the user reach there for the first time (external
    >> link)
    >> else the user came from your website and you know from witch page
    >>
    >> hope it helps
    >>
    >> --
    >>
    >> Bruno Alexandre
    >> København, Danmark
    >>
    >> "a portuguese in Denmark"
    >>
    >>
    >> "Opa" <> escreveu na mensagem
    >> news:...
    >> > Hi,
    >> >
    >> > I would like to know if there is an event that will tell me when a page
    >> > is
    >> > being redirected and also the url of where the page is being
    >> > redirected.
    >> > Is there an event that is fired which will give me this information.
    >> >
    >> > Note: I want to use this event to remove a session variable.
    >> >
    >> > Thanks in advance

    >>
    >>
    >>
     
    Bruno Alexandre, Oct 5, 2006
    #4
  5. Obrigado Bruno.

    "Bruno Alexandre" wrote:

    > the same thing applies !
    >
    > Protected Sub Page_Unload(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles Me.Unload
    >
    > End Sub
    >
    >
    > --
    >
    > Bruno Alexandre
    > København, Danmark
    >
    > "a portuguese in Denmark"
    >
    >
    > "Opa" <> escreveu na mensagem
    > news:...
    > > Yes, I know about IsPostBack,
    > > but I want to know when a page is Unloaded
    > > or "being" redirected to another page.
    > >
    > > How do I check for this?
    > >
    > > "Bruno Alexandre" wrote:
    > >
    > >>
    > >>
    > >> if not Page.isPostBack then
    > >> ' the page came from a link, not from a Postback in the same page
    > >> end if
    > >>
    > >>
    > >> to see what was the previous page link, just use session variables
    > >> ( http://www.filtrarte.com/sessions.asp )
    > >> the PATH_INFO give's you the page, just have a session called
    > >> session("PageInfo") and set it in the Master page
    > >> like session("PageInfo") = request.serverVariables("PATH_INFO")
    > >>
    > >> then when you get inside the not Page.isPostBack if
    > >> you can always see if that session has something and what it is
    > >> if is nothing then the user reach there for the first time (external
    > >> link)
    > >> else the user came from your website and you know from witch page
    > >>
    > >> hope it helps
    > >>
    > >> --
    > >>
    > >> Bruno Alexandre
    > >> København, Danmark
    > >>
    > >> "a portuguese in Denmark"
    > >>
    > >>
    > >> "Opa" <> escreveu na mensagem
    > >> news:...
    > >> > Hi,
    > >> >
    > >> > I would like to know if there is an event that will tell me when a page
    > >> > is
    > >> > being redirected and also the url of where the page is being
    > >> > redirected.
    > >> > Is there an event that is fired which will give me this information.
    > >> >
    > >> > Note: I want to use this event to remove a session variable.
    > >> >
    > >> > Thanks in advance
    > >>
    > >>
    > >>

    >
    >
    >
     
    =?Utf-8?B?T3Bh?=, Oct 5, 2006
    #5
    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. M O J O
    Replies:
    5
    Views:
    333
    Steven Cheng[MSFT]
    Sep 27, 2004
  2. darrel
    Replies:
    4
    Views:
    792
    darrel
    Sep 29, 2004
  3. Replies:
    8
    Views:
    5,620
  4. Steve
    Replies:
    2
    Views:
    526
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Nov 1, 2007
  5. Replies:
    4
    Views:
    411
    William Gill
    Jan 7, 2013
Loading...

Share This Page