I’m looking to get a more thorough understanding of the ASP.NET page lifecycle. I’m in the process of building custom form controls and have found my knowledge in this area to be lacking.
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
I have this on my tack board. Helpful when your using Master pages.
- Content page PreInit event
- Master page controls Init event
- Content controls Init event
- Master page Init event
- Content page Init event
- Content page Load event
- Master page Load event
- Master page controls Load event
- Content page controls Load event
- Content page PreRender event
- Master page PreRender event
- Master page controls PreRender event
- Content page controls PreRender event
- Master page controls Unload event
- Content page controls Unload event
- Master page Unload event
- Content page Unload event
I’ve found this chart to be fairly useful. Provides a brief description as to what the piece is doing…
John-Sheehan ASP.NET Life Cycle Events
This is the “original” MSDN overview. Pretty good:
Honestly, you shouldn’t need our help to find these things. Try Google.
This diagram is specifically helpful in determining the order of events, but doesn’t elaborate on them in any detail.
This doesn’t directly answer the Page lifecycle question but this covers the Global event lifecycle with events like BeginRequest and EndRequest. It’s good to understand how those work in relation to Pages.