How to trap backbutton of IE 6.0

G

Guest

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

bruce barker \(sqlwork.com\)

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

Guest

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.
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top