473,320 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Page_Load Doesn't Execute

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.
Nov 17 '05 #1
1 1151
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");

"German Kruszewski" <ge**********@empresadesistemas.com> wrote in message
news:06****************************@phx.gbl...
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.
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rohan Parkes | last post by:
I'm fairly new to ASP.NET, and am trying out the Online Newsletter Manager project in Wrox's Beginning C#. The pages are supposed to bind various controls (dropdown lists, datagrids) when the pages...
1
by: darrel | last post by:
I'm trying to create a usercontrol that links to the same page as it is on along with a new query string in hopes that I can trigger the 'Sub Page_Load' to grab the querystring and reformat the...
4
by: Julia | last post by:
Hi Everyone, I am using webbrowser control to post data to an aspx page. However, for some reason, the aspx page sometimes will execute page_load event twice, and sometimes execute it once. So I...
5
by: Scott Natwick | last post by:
Is there a way to execute a JavaScript from the Page_Load event? Or alternatively, is there a way to have it execute when the page is loaded? I am defining the script in the Page_Load event and...
13
by: David Lozzi | last post by:
Howdy My following script is not processing at all! <script runat="server"> Sub Page_Load(sender as Object, e as EventArgs) lblWelcome.text = "hello" End Sub </script>
1
by: jhcorey | last post by:
This has got me puzzled. I was actually working with a stylesheet when the Page_Load function of my page stopped getting called. I debugged, and the debugger will stop in the OnInit function, but...
5
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page myadd.dll - Contains PageBase which inherits...
17
by: Arpan | last post by:
When a Button is clicked in a Web Form in an ASPX page, the Form will post back to itself. Under such circumstances (i.e. when a Button is clicked), will the Page_Load sub execute first & then will...
4
by: David C | last post by:
I spent the last four hours trying to figure out why Page_Load would execute twice. Even stranger was that everything within if (! IsPostBack){....} executed twice as well. There is no rhyme or...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.