In the ASP.NET Page LifeCycle there is the Page.LoadComplete event.
The MSDN documentation says 'Use this event for tasks that require that all other controls on the page be loaded'. What exactly might this be? What would a 'best practice' say that LoadComplete should be used for?
When you hook up several methods to the Load event you don't know the order they will get called. So you have the PreLoad, Load and LoadComplete events to have some more control as to in what order your code gets called.
The use of this might not always be clear when working only with your page class. When working with controls however, with the need to have some code running at Load time, you might want to make it run right before or right after what would normally happen in the Load event. Then you can use the PreLoad and LoadComplete methods.
As simon mentioned, the same pattern is followed with the Init event...
More information can be found in this MSDN article about the ASP.NET Page Lifecycle
EDIT: It seems, from the MSDN article that LoadComplete is called AFTER your control events like Button.Click have been raised.
Say you have multiple controls that prepare some data in the load event. If you want to take action on that data in the load step of the ASP.NET lifecycle you need to have a way to execute after all the other load's have run. Hence the "load complete". There's also an "init complete".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With