How to empty cache

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?
 
B

Bharathi Kumar

<%@ OutputCache Duration="1" Location="None" %>

Try this in orignal page and in pop-up page also.
 
G

Guest

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?
 
T

Tarren

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.
 
G

Guest

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.
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top