• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

urgent:ASP page won't refresh

Hi, I'm new to developing ASP pages
actually im new to developing anything

my pages simply won't refresh.
for example,i would have a pull down menu that allows me to remove a category from my database
after removing a particular category, if i click on the remove category link,
the drop down menu will still show me the category that i have just removed, eventhough it is already removed.
but when i refresh the page (f5 button), the pull down menu will display correctly the categories.

my shopping cart page has the same problem also.
unless i hit on refresh button, the page will not display the newly added items, eventhough it's already added to my session.

im using dreamweaver mx and IIS on my laptop(winXP) with SQL for my database.

the frustrating is that my pages were working fine a few days ago, no refreshing problem.
i did not make any changes to my system config, not that i remember of.
so i have no idea what is causing this.
I hope someone can help me asap because my project deadline is very near
1 Solution
Add this code to the top of each page (or add it as an include):

Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"

Some related KB articles include:

to use it as an include:

1. save the code as no_cache.asp:

Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"

2. at the top of each asp page write:

<!-- #include file="no_cahce.asp" -->
Markhoy's response is really good.  You just have to remember, if there is a proxy server between you're client and server (and there usually is), sometimes the proxy servers dis-regard these tags and cache the data anyway....

Sometimes, if you had a random variable on your URL it will help with the problem too--somthing like this:

response.redirect ("mypage.asp?random=" & time)

juljulAuthor Commented:
Hi markboy,

I have tried what you suggested me to do and it works!
however, another problem arises,
my pages can't be viewed on dreamweavermx.
I have templates on my pages.
On some pages, I'm not able to add the code in, the error is that "Making this change would require changing code that is locked by a template or a translator. The change will be discarded."
For those pages that I can actually add the code, eventhough I have no idea why because these pages have the same templates, all that shows up on design view , after I add that 1 line, is just an empty page.
I can only manipulate it from code view, I can't see the result on design view.
Do you have any idea how I can fix this prob?
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer by markhoy

Please leave any comments here within the next seven days.
EE Cleanup Volunteer

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now