Showing posts with label executed. Show all posts
Showing posts with label executed. Show all posts

Wednesday, March 28, 2012

Page_Load always executed - can this be changed?

Hello,

I started using <asp:UpdatePanel> to update controls content in my page.

This work really great, and the Look and Feel are perfect.

However, in the page I load many controls dynamically in the Page_Load - it can reach thousands of controls.

Each of the controls contains UpdatePanel that has UpdateMode of "Conditional" - this let me change the contents of each control without affecting the other controls.But, and here finally come the catch, I noticed the whole Page_Load is executed. When there will be thousands of controls, I would like to Load them only once, then have AJAX code that would not cause the whole Page_Load to run again.

Is this possible? Can we make the AJAX read other page maybe?

Thanks in advance. :)

If you want to only run the code on the initial Page Load, you can throw everything in if(!Page.IsPostBack && !Page.IsCallBack). We use that method for most stuff, but if you use 3rd party controls, there may be some issues... We use telerik controls and they do a post back like event, which isn't caught by that.

Well, if I add if (!Page.IsPostBack) then the controls are lost, as they're not static in the page but rather created on the fly using Page.LoadControl method.

What I'm trying to achieve is that different page will be called by the AJAX "engine". So far my investigations on this bore no fruit. Any ideas?

PageMethod Code Caching

Hi,

When I change the code of my pagemethod, I have to run IISRESET for the new code to take affect.
If I don't, then the old code is still executed. Building the page or the project doesn't help either.

Any ideas?

Are you sure it's not just caching the js proxy in your browser?

Yes, I'm sure.

I did some more testing. Seems that building the whole project again is actually enough to get the new code to be excuted. (so iisreset not required). But building the page on itself is not enough.


Interesting. i would've expected <compilation debug='true' /> to be enough to force the rebuild per change. I wonder if there's some level of page caching set up in the machine.config?


hello,I am experiencing the same problem.

http://forums.asp.net/thread/1668850.aspx

don't give up on this!