.NET (web) How to execute some code after all events are handled?

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.

Answers


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.


Check out the OnPreRender event in the page lifecycle.

-Oisin


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


Need Your Help

FB init function gives wrong version error

javascript facebook-javascript-sdk

I'm using the Facebook JS sdk, and I have created a new App today.

What is the command to exit a Console application in C#?

c# console-application exit

What is the command in C# for exit a Console Application?