force page refresh with response.expires=0?

  • Thread starter Thread starter qqq
  • Start date Start date
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.
 
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
 
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")
 

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

Back
Top