Solved

How to catch browser back button event

Posted on 2002-04-22
8
454 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
8 Comments
 

Accepted Solution

by:
tittlejoseph earned 50 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
 

Expert Comment

by:tittlejoseph
ID: 6963368
try above meta tag on head part of the page
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

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

Expert Comment

by:adilkhan
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now