Overview
Read the original
Page Events: Order and PostBack for more details. ASP.NET v2.0 (Whidbey) adds Pre and Complete versions of the Init and Load events, as well as a Complete version for the PreRender event. There are also some new internal methods for Personalization and Themes/Skins, as well as a ControlState that is different from ViewState. My favorite (at the moment anyhow) is the TestDeviceFilter method, which can be overridden to implement
Dynamic Masters using Filters. The new ASP.NET v2.0 page/control methods are indicated in
bold type in the comprehensive lifecycle chart provided below:
|
Method |
PostBack |
Controls |
Virtual |
|
Constructor |
Always |
All |
Yes |
Construct |
Always |
Page |
Yes |
TestDeviceFilter |
Always |
Page |
Yes |
AddParsedSubObject |
Always |
All |
Yes |
DeterminePostBackMode |
Always |
Page |
Yes |
OnPreInit |
Always |
Page |
Yes |
|
LoadPersonalizationData |
Always |
Page |
No |
InitializeThemes |
Always |
Page |
No |
OnInit |
Always |
All |
Yes |
ApplyControlSkin |
Always |
All |
No |
ApplyPersonalization |
Always |
All |
No |
OnInitComplete |
Always |
Page |
Yes |
|
LoadPageStateFromPersistenceMedium |
PostBack |
Page |
Yes |
LoadControlState |
PostBack |
All |
Yes |
LoadViewState |
PostBack |
All |
Yes |
ProcessPostData1 |
PostBack |
Page |
No |
OnPreLoad |
Always |
Page |
Yes |
OnLoad |
Always |
All |
Yes |
|
ProcessPostData2 |
PostBack |
Page |
No |
RaiseChangedEvents |
PostBack |
Page |
No |
RaisePostBackEvent |
PostBack |
Page |
No |
OnLoadComplete |
Always |
Page |
Yes |
OnPreRender |
Always |
All |
Yes |
OnPreRenderComplete |
Always |
Page |
Yes |
|
SavePersonalizationData |
Always |
Page |
No |
SaveControlState |
Always |
All |
Yes |
SaveViewState |
Always |
All |
Yes |
SavePageStateToPersistenceMedium |
Always |
Page |
Yes |
Render |
Always |
All |
Yes |
OnUnload |
Always |
All |
Yes |
|
Version Note
This article was based on an early Alpha release of ASP.NET v2.0 and VS.NET Whidbey. It is possible that some implementation or v1.* compatibility details will change.
Author Bio
Paul Wilson is a software architect in Atlanta, currently with PRG-Schultz. He specializes in Microsoft technologies, including .NET, C#, ASP, SQL, COM+, and VB. His
WilsonWebForm Control allows Multiple Forms and Non-PostBack Forms in ASP.NET. He is a Microsoft MVP in ASP.NET and is also recognized as an
ASPInsider. He is a moderator on Microsoft's
ASP.NET Forums, as well as one of the top posters. He is holds the MCSD, MCAD, MCDBA, and MCSE certifications. Please visit his website,
www.WilsonDotNet.com, or email him at
Paul@WilsonDotNet.com.