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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh Just Once

Status
Not open for further replies.

rhull

Programmer
May 23, 2001
46
US
I am having trouble for coming up with code that will
Refresh just Once as soon as the page is loaded. So if the user hits the back button or the direct link to it, I need it to refresh the next loaded page.

The META tags will just loop, so that didnt fly.

Any ideas??
Thanks!

-R
 
I don't understand the goal. Could you explain how someone gets to this page, and what you must do upon back()? gettin' jiggy wid' it --
smbure
 
Basically if the user hits the BACK button on their browser
I would like for the page to rerun the ASP code. I need to redirect the user to another page, basically I dont want them to go back. If there is a better way to do it Im up for suggestions.
Thanks!
-Ryan
 
You can use this code to force a no-cache load of every page. If the user hits "back" on a page that should have some sort of inputs, etc... (i.e. one that you would not want them to hit back on), then they will receive a "Warning -- page expired, etc..." message from their browser and either refresh the page (running the asp again), or go back to where they were and jump through your hoops (buttons, etc.).

I usually put this bit of code in an include file, and just include it on any page I want loaded fresh every time.

<%
Response.Expires = 15
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader &quot;pragma&quot;,&quot;no-cache&quot;
Response.AddHeader &quot;cache-control&quot;,&quot;private&quot;
Response.CacheControl = &quot;no-cache&quot;
%>

and thx to leo (vasah20) for this code.

:)
Paul Prewett
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top