How to set when "Check for newer versions of stored pages" happens

G

Guest

In Internet Explorer under the tools/internet options menu on the general
tab, there is a settings button under Temporary internet files. In there the
user can specify when to "Check for newer versions of stored pages." I want
to make sure that my pages are refreshed every time they visit regardless of
this setting. Is there a way to do this? Thanks ... Ed
 
K

Ken Cox - Microsoft MVP

Hi Ed,

You can try adding headers to your pages so that servers and browsers don't
store them, but there's no guarantee they'll honour this. Here's some code
to try:

Private Sub Page_Load _
(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles MyBase.Load
Response.Expires = 0
Response.AddHeader("Pragma", "no-cache")
Response.AddHeader("cache-control", "no-store")
Response.ExpiresAbsolute = DateTime.Now.ToString
End Sub

Ken
Microsoft MVP [ASP.NET]
 
G

Guest

I'm also running into the same issue. I'm beta testing a product for a client
on our server. I'm using master pages in asp.net 2.0, and a menu control
populated from sql server. My first screen is a login screen. The user logs
in, which takes her to the default.aspx page. She visits a page on the site,
and then logs off. Then she (who is an admin) logs in as someone else.
Instead of taking her to the default.aspx page, it takes her back to the page
she last visited.

The only temporary solution that works is to have her change her IE settings
so that the browser checks for newer pages "Every visit to the page." I say
temporary because I really can't have her ask her users to change their
browser settings.

I've put your code in every Page_Load of the master pages, and
Page_LoadComplete of the default.aspx page and login.aspx page, but I'm still
having the same problem.

Is there anything else that you might know of that will help? This will be a
problem in every web project using asp.net 2.0!

Ken Cox - Microsoft MVP said:
Hi Ed,

You can try adding headers to your pages so that servers and browsers don't
store them, but there's no guarantee they'll honour this. Here's some code
to try:

Private Sub Page_Load _
(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles MyBase.Load
Response.Expires = 0
Response.AddHeader("Pragma", "no-cache")
Response.AddHeader("cache-control", "no-store")
Response.ExpiresAbsolute = DateTime.Now.ToString
End Sub

Ken
Microsoft MVP [ASP.NET]

Ed Staffin said:
In Internet Explorer under the tools/internet options menu on the general
tab, there is a settings button under Temporary internet files. In there
the
user can specify when to "Check for newer versions of stored pages." I
want
to make sure that my pages are refreshed every time they visit regardless
of
this setting. Is there a way to do this? Thanks ... Ed
 

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

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top