Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make the page expire

Status
Not open for further replies.

tonylnng

Programmer
Jan 9, 2003
21
HK
Hi folks,

Does anyone know how to make the page expire when press "back" button?

Any help is highly appreciated, thanks!


Best,

Tony

 
ASP has no association with the browser on that level (client level) you will need to run a script somehow with the means of a submission etc..

to end a session you would use
session.abandon

exactly what is it you mean by expire? session ends? _______________________________________________
{ str = "sleep is good for you. sleep gives you the energy you need to function";
ptr = /sleep/gi;Nstr = str.replace(ptr,"coffee");alert(Nstr); }

_______________________________________________
for the best results to your questions: FAQ333-2924

 
Actually, the page does not used session and I just want to prevent the visitor press "back" button to see the content.

Basically, we have been done before but the code is missing. As I remember, it just set a few line in asp then can force the page expire by "back" button.

Any idea? Thanks!
 
If you just want to disable the back button then this in the page where you dont want them to go back to will cause the browser to move back to the current page.

<script language=javascript>
window.history.forward();
</script> Saturday 12.00
im6.gif
im2.gif
im2.gif
20.00
im5.gif
im4.gif
im7.gif
3.00am
im8.gif
Sunday [img http
 
Another option is to use a hidden page to redirect to the new page...

Page1.asp
<% response.expires = 0 %>
<a href=&quot;redir.asp&quot;>Next Page</a>

redir.asp
response.redirect &quot;page2.asp&quot;

Get the Best Answers! faq333-2924
&quot;A witty saying proves nothing.&quot; - Voltaire
mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top