469,593 Members | 2,057 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,593 developers. It's quick & easy.

How to trap backbutton of IE 6.0

mac
I am building web applcation using ASP.NET on IE 6.0. The requirement is to
show a popup when user clicks back button and perform clean up operation.
Does anybody knows how to do it. I am using xmlhttp to hit to server by
checking event.clientY < 0. The problem occurs when the user selects
dropdownlist value from back button. Secondly i tried coding on body.unload
event but it fires popup on refresh and other events as well which is not
desirable.

Any help is appreciated.
Jun 7 '06 #1
2 1318
the back button is just a nvigation request. you can not catch the url in
client script (unless you wrote an active/x control that hooked into the
browser and caught the navigation events). You are on the correct track. you
want to use the unload event. on all valid postbacks from the page, you want
to set a flag the unload event checks before processing the cleanup logic.
also if your site does not support the back button, then set the pages to
not be cached, and the browser will refetch them, giving the server a chance
to detect the back request.

-- bruce (sqlwork.com)

"mac" <ma*@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.com...
I am building web applcation using ASP.NET on IE 6.0. The requirement is
to
show a popup when user clicks back button and perform clean up operation.
Does anybody knows how to do it. I am using xmlhttp to hit to server by
checking event.clientY < 0. The problem occurs when the user selects
dropdownlist value from back button. Secondly i tried coding on
body.unload
event but it fires popup on refresh and other events as well which is not
desirable.

Any help is appreciated.

Jun 7 '06 #2
mac
bruce,
thanks for reply. I like the idea of seting flag on postback and check
that in unload event. But how should i handle refresh ? I dont want to
perform cleanup on refresh. I only want it to do on back or forward button.

"bruce barker (sqlwork.com)" wrote:
the back button is just a nvigation request. you can not catch the url in
client script (unless you wrote an active/x control that hooked into the
browser and caught the navigation events). You are on the correct track. you
want to use the unload event. on all valid postbacks from the page, you want
to set a flag the unload event checks before processing the cleanup logic.
also if your site does not support the back button, then set the pages to
not be cached, and the browser will refetch them, giving the server a chance
to detect the back request.

-- bruce (sqlwork.com)

"mac" <ma*@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.com...
I am building web applcation using ASP.NET on IE 6.0. The requirement is
to
show a popup when user clicks back button and perform clean up operation.
Does anybody knows how to do it. I am using xmlhttp to hit to server by
checking event.clientY < 0. The problem occurs when the user selects
dropdownlist value from back button. Secondly i tried coding on
body.unload
event but it fires popup on refresh and other events as well which is not
desirable.

Any help is appreciated.


Jun 7 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by pemo | last post: by
2 posts views Thread by ramu | last post: by
10 posts views Thread by pemo | last post: by
reply views Thread by Bill Schmidt | last post: by
6 posts views Thread by temper3243 | last post: by
17 posts views Thread by Army1987 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.