473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to determine when a page is being redirected

Opa
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
Oct 5 '06 #1
4 3252


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" <Op*@discussions.microsoft.comescreveu na mensagem
news:64**********************************@microsof t.com...
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

Oct 5 '06 #2
Opa
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" <Op*@discussions.microsoft.comescreveu na mensagem
news:64**********************************@microsof t.com...
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


Oct 5 '06 #3
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" <Op*@discussions.microsoft.comescreveu na mensagem
news:CE**********************************@microsof t.com...
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" <Op*@discussions.microsoft.comescreveu na mensagem
news:64**********************************@microso ft.com...
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



Oct 5 '06 #4
Opa
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" <Op*@discussions.microsoft.comescreveu na mensagem
news:CE**********************************@microsof t.com...
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" <Op*@discussions.microsoft.comescreveu na mensagem
news:64**********************************@microsof t.com...
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


Oct 5 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: droog | last post by:
hi group! I am new to PHP and so far managed to find my answers by searching this group instead of posting repeating questions, but I don't know what to search for to get answer to this...
4
by: TG | last post by:
Hi, I have a question concerning redirecting users who have logged in using our login page. Once they have properly filled out the form they should be redirected back to the last page they were...
3
by: Marco | last post by:
Hi All Could anyone help me, pls? I am trying to run a .net application from my computer. This app is in another server. Everytime I try to launch the application, e.g....
1
by: David Krussow | last post by:
I have implemented ASP.NET Forms authentication in a test app. The app has a number of forms - only one of which requires authentication in order to be viewed (the "secured form"). Everything works...
12
by: ACaunter | last post by:
Hi all, I was wondering how i could write some code which would automatically open the Login Page once the session has expired? -- AdamPC@hotmail.com
2
by: dee | last post by:
Hi In web.config I have to the following: <configuration> <system.web> <customErrors defaultRedirect="error.htm" mode="On" /> </system.web> </configuration>
6
by: dee | last post by:
Hi In web.config I have to the following: <configuration> <system.web> <customErrors defaultRedirect="error.htm" mode="On" /> </system.web> </configuration>
7
by: Alan Silver | last post by:
Hello, Sorry this is a bit wordy, but it's a pretty simple question... I have a web site, http://domain/ which is a public site, part of which (http://domain/a/) is protected by forms...
5
by: mherman3 | last post by:
I have a page that sends a request to another PHP page on my site. If I try and set the header in the page that is being called, with header(Location: ...), the site doesn't get redirected like I'd...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.