Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to catch browser back button event

Posted on 2002-04-22
8
Medium Priority
?
466 Views
Last Modified: 2010-05-18
I need to catch browser back button event. Actually I need that whenever user click the back button of browser the result must be got from the server i.e ASP script should also run. Is it possible?

Waiting for your reply.

Thanks
AQ
0
Comment
Question by:aqk139
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 

Accepted Solution

by:
tittlejoseph earned 200 total points
ID: 6959245
I too searched for it many times, but never got this, and frankly speaking there are no event/method meant for it. But yeah you can track if someone is trying to change the page and then stop him for doing so
e.g.

<body onunload="return checkpage()">

function checkpage()
{
 if (confirm('you are trying to surf outside this page\nsure?'))
 return true;

return false;
}

//Warning: Above function will also get execute even if you submit the page.

The other way is expire the ASP page immediately so that whenever it is accessed clicking on back button it is refreshed from web server.

for this use <meta tag> search syntax on web
or use expire property of asp.
0
 

Author Comment

by:aqk139
ID: 6961879
Using expire property of ASP does not work. What is the proper place of using this property. I mean at the begining of page or end of page. I tried both but failed.
0
 

Expert Comment

by:tittlejoseph
ID: 6963367
Try this, should work

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="1981">
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:tittlejoseph
ID: 6963368
try above meta tag on head part of the page
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6974050
Has this helped?
Moondancer - EE Moderator
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 7033854
if you want the Code, to Get Rid of Sessions(Logout Page).then I have the Code, Lemme know if you need it for ASP Sessions.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7078221
Please return to this question to update and finalize it.

If Asker does not respond, EXPERTS please guide me with closing recommendations.

Thanks,
Moondancer - EE Moderator
0
 
LVL 58

Expert Comment

by:Gary
ID: 8823981
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept Answer by tittlejoseph
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question