How to empty cache

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I set a Web ASP button to have its OnClientClick set to a javascript that
opens a window. For some reason, every other time I click on the button it
displays the older webpage from the cache rather than the most recent. I
added an instruction to clear out the cache by doing the following in the
server OnClick

proctected void Button1_Click(object sender, EventArgs e)
{

Response.Cache.SetExpires(DateTime.Now);
}

Can you have the Button's server OnClick and On Client Click both set at the
same time? Also, what do I have to do to clear out the cache before the
javascript is executed?
 
<%@ OutputCache Duration="1" Location="None" %>

Try this in orignal page and in pop-up page also.
 
Bharathi;
Thanks for your response. I inserted the parameters that you suggested but
it still displays the old webpage or the previous cache every other time.
Really is very puzzling. Any other suggetions?
 
Add a dummy querystring with a random value (e.g the ticks of current time)
so it will always be a unique url being passed.
 
I guess that would work using a unique url each time but that seems like I am
programming around a problem. What I don't understand is that if I use an
html input button and click it to open a windowit I don't have the problem
with caching but if I do it by clicking on an ASP NET web button, I get the
caching problem which tells me there is a problem in ASP NET Framework.
 
Back
Top