Solved

backbutton asp reload

Posted on 1998-09-05
4
153 Views
Last Modified: 2013-12-25
If I use the back button the page doesn't run the asp instead it used the cache. It works good with ie4sp1. Anyone who have solved this one?

---
3 asp pages
<%
response.expires=0  'makes it works with ie4sp1
Session("kalle")=1
response.write Session("kalle")
%>
<p><a href="two.asp">cont</a></p>
---
<%
response.expires=0  
Session("kalle")=Session("kalle")+1
response.write Session("kalle")
%>
<p><a href="tre.asp">cont</a></p>
---
<%
response.expires=0  
Session("kalle")=Session("kalle")+1
response.write Session("kalle")
%>
0
Comment
Question by:manne
  • 3
4 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 1854776
I would look for a solution by combining ASP and Javascript. I can work out code if you want, but here is just the idea:

- While loading, ASP writes the time to a JS-variable.
- Another JS-variable is set to the current date/time
- Both are compared, and when the difference is bigger then say 10 seconds, the page is forced to reload by Javascript.

The trick is that when the backbutton is used, and the page comes from the cache, so the ASP-set JS variable is old.
However, the JS-variable which is set to current date/time refreshes even when the backbutton is used.

code would be something like this:

<script language="Javascript">
<%
tmLoaded = Now()
Response.write "tmLoaded = new Date(...date/time based on tmLoaded);" & CHR(10)
%>
tmDisplayed = new Date();

if (tmLoaded-tmDisplayed > 10) {document.reload();}
</script>
0
 

Author Comment

by:manne
ID: 1854777
doesn't the backbutton have a event where you can place location.reload()
0
 
LVL 28

Accepted Solution

by:
sybe earned 100 total points
ID: 1854778
Ok, I found some time to make a working code:

<script language="Javascript">
<%
tmLoaded = Now()
Response.write "tmLoaded = new Date(" & Year(tmLoaded) & "," & (Month(tmLoaded)-1) & "," & Day(tmLoaded)& "," & Hour(tmLoaded)& "," & Minute(tmLoaded) & "," & Second(tmLoaded) & ");" & CHR(10)
%>
tmDisplayed = new Date();
if (tmDisplayed-tmLoaded > 5000) {document.location.reload();}
</script>

0
 
LVL 28

Expert Comment

by:sybe
ID: 1854779
Manne,

I don't know if you realize it, but I am really proud of the code I showed you. Mainly because it works, and I did not think it would be possible to make a thing like that work.

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Swiper slider stops between pages 11 45
Problem to ToolkitScriptManager 2 51
Firebug on Firefox 50 2 67
What .NET URL re-routing tool did I use? 2 34
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

930 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

10 Experts available now in Live!

Get 1:1 Help Now