tags:

views:

92

answers:

4

Hi,

I have this .NET web app that draws a table in Page_Load.

Then after that it handles the events, which should change the table drawn in Page_Load. This is very inefficient.

Is there a way to execute the code (which draws the table) after it finishes handling all events? (instead of doing it in Page_Load)

Thank you in advance.

A: 

Check out the OnPreRender event in the page lifecycle.

-Oisin

x0n
+5  A: 

You need to handle an event that occurs after the control events, but before the page is rendered, such as LoadComplete or PreRender.

Check out the ASP.NET Page Life Cycle Overview for more info.

cxfx
A: 

You could also put the code in a Timer tick event with an interval of 1, which will fire after all the events.

gfrizzle
A: 

Great! Thank you guys.

And the page life cycle page can be useful, thanks for that :)

comment instead of adding answers
JohnIdol