• 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
=p

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
Thanks
0
juljul
Asked:
juljul
1 Solution
 
markhoyCommented:
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:
http://support.microsoft.com/support/kb/articles/q189/4/09.asp?FR=0
http://support.microsoft.com/support/kb/articles/q172/8/96.asp?FR=0
http://support.microsoft.com/support/kb/articles/q165/1/50.asp?FR=0


http://www.learnasp.com/learn/cachenomore.asp
0
 
markhoyCommented:
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" -->
0
 
arbertCommented:
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)


Brett
0
 
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?
0
 
GaryCommented:
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.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0

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