force page refresh with response.expires=0?

Q

qqq

I need a page to be refreshed, even if the user navigates back to it with
the 'Back' button in the browser. I've put "Reponse.expires=0" in the
Page_load event, but the desired refresh isn't happening. Of course it does
refresh if the user hits F5. Why?

(When I do View/Source from the browser to look at the html, there's no
reference to "Expires").

Thanks, Paul.
 
R

Rutger Smit

qqq said:
I need a page to be refreshed, even if the user navigates back to it with
the 'Back' button in the browser. I've put "Reponse.expires=0" in the
Page_load event, but the desired refresh isn't happening. Of course it does
refresh if the user hits F5. Why?

(When I do View/Source from the browser to look at the html, there's no
reference to "Expires").

Thanks, Paul.


In classic asp I used this:
Response.Expires = 0
Response.Expiresabsolute = Now() - 1442
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"

Just trabslate it and you're done.

//Rutger
 
S

Steve C. Orr [MVP, MCSD]

There are several ways a page can be cached, and so there are several ways
you can specify for a page to not be cached.
This code has worked well for me:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
 
Joined
Jul 7, 2007
Messages
1
Reaction score
0
to clear IE7 cache

Hai all,
i have tried al the above methods...and i have used them in the top of my asp page...still no use.

i am scripting in asp and using IE7 browser.
i have problem with IE browser cache.Mainly its giving problem with taking images.its taking them from cache not from server.

som times..even when i have updated javascript file (replaced the file with new changes) in the server...and refreshed there..the browser is taking the old script only..

this is going to be a problem for me...
please help me...

thanks in advance..
suneel.
 
Joined
Jun 28, 2007
Messages
2
Reaction score
0
This sort of works but it forces the user to have to perform manual intervention aside from clicking the back button.

What it needed in my case is a automatic refresh when the user clicks the back button

any ideas how to do this with out the user knowing a refresh is needed or being performed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top