How to determine when a page is being redirected

G

Guest

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
 
B

Bruno Alexandre

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"
 
G

Guest

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?
 
B

Bruno Alexandre

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"
 
G

Guest

Obrigado Bruno.

Bruno Alexandre said:
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"
 

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,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top