Link to home
Start Free TrialLog in
Avatar of juljul
juljul

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of markhoy
markhoy
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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" -->
Avatar of arbert
arbert

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
Avatar of juljul

ASKER

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?
Avatar of Gary
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