472,098 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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 1372
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

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.