Page_Load Doesn't Execute

G

German Kruszewski

Hi.
I have this problem: I have some code that loads an HTML
string into a public variable. That code is executed in
the Page_Load event. So the problem is that, when I
navigate the web, the page_load event sometimes get fired,
and sometimes not.
This is because the Explorer doesn't download the page
again form the Server, using the version that it haves in
the Cache.
I know that setting properly the IE, I can make it
download the page on every request, but what I want is
that the explorer refresh the view of the page without
doing so.
Can anybody help me? or in a better way... did anybody
understand what I asked for? :p

Thanks.
Germán.
 
R

Ron Vecchi

Try some of these in your code behind.

Make sure to set these prior to sending anything else to the browser.
Headers must be sent first. I dont think asp.net handles it for you.

Response.Cache.SetExpires(DateTime.Now);
Response.CacheControl = "no-cache";
Response.Expires = -1;
Response.AddHeader("Pragma","no-cache");



Hi.
I have this problem: I have some code that loads an HTML
string into a public variable. That code is executed in
the Page_Load event. So the problem is that, when I
navigate the web, the page_load event sometimes get fired,
and sometimes not.
This is because the Explorer doesn't download the page
again form the Server, using the version that it haves in
the Cache.
I know that setting properly the IE, I can make it
download the page on every request, but what I want is
that the explorer refresh the view of the page without
doing so.
Can anybody help me? or in a better way... did anybody
understand what I asked for? :p

Thanks.
Germán.
 

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,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top