Graciously Hosted by MaximumASP        

Unwinding the page lifecycle events

Since I spent some time today working with control extenders and exactly where in the page lifecycle to do what, I thought I’d share the whole list.

If (!IsPostBack)

  1. Begin PreInit
  2. End PreInit
  3. Begin Init
  4. End Init
  5. Begin InitComplete
  6. End InitComplete
  7. Begin PreLoad
  8. End PreLoad
  9. Begin Load
  10. End Load
  11. Begin LoadComplete
  12. End LoadComplete
  13. Begin PreRender
  14. End PreRender
  15. Begin PreRenderComplete
  16. End PreRenderComplete
  17. Begin SaveState
  18. End SaveState
  19. Begin SaveStateComplete
  20. End SaveStateComplete
  21. Begin Render
  22. End Render

If(IsPostBack)

  1. Begin PreInit
  2. End PreInit
  3. Begin Init
  4. End Init
  5. Begin InitComplete
  6. End InitComplete
  7. Begin LoadState
  8. End LoadState
  9. Begin ProcessPostData
  10. End ProcessPostData
  11. Begin PreLoad
  12. End PreLoad
  13. Begin Load
  14. End Load
  15. Begin ProcessPostData (Again)
  16. End ProcessPostData (Again)
  17. Begin Raise ChangedEvents
  18. End Raise ChangedEvents
  19. Begin Raise PostBackEvent
  20. End Raise PostBackEvent
  21. Begin LoadComplete
  22. End LoadComplete
  23. Begin PreRender
  24. End PreRender
  25. Begin PreRenderComplete
  26. End PreRenderComplete
  27. Begin SaveState
  28. End SaveState
  29. Begin SaveStateComplete
  30. End SaveStateComplete
  31. Begin Render
  32. End Render

» Similar Posts

  1. Adding Persistence to the .NETOOP Edit in Place control.
  2. ASP.NET AJAX Postback Event Validation
  3. The Scoble Gap ?

» Trackbacks & Pingbacks

  1. Pingback from Unwinding the page lifecycle events : Misfit Geek

  2. Pingback from Twitter Trackbacks for Unwinding the page lifecycle events : Misfit Geek [misfitgeek.com] on Topsy.com

  3. Pingback from Unwinding the page lifecycle events | I love .NET!

  4. Thank you for submitting this cool story - Trackback from progg.ru

  5. links for 2010-01-26

    links for 2010-01-26 — January 27, 2010 12:06 AM
  6. Today's Bookmarks (Jan 27 2010)

    Today's Bookmarks (Jan 27 2010) — January 27, 2010 5:41 PM

» Comments

  1. jdn avatar

    Ouch. While it is great information, it is lists like this that make so many people dislike Web Forms completely.

    I personally like PreInit and Init. Wish there was a PrePreInit or AlmostReadyToGetStartedInit.

    jdn — January 21, 2010 8:15 PM
  2. RACK avatar

    It is great

    RACK — January 21, 2010 8:34 PM
  3. cutie avatar

    interested

    cutie — January 21, 2010 8:38 PM
  4. José Luis Chávez del Cid avatar

    Still the performance is way better than the competitors, and flexible enough too. Might be a bit hard to get it the first time, but have seen worst things in programming. I'd still use ASP.NET Pages and not planning to change to MVC. :)

    Thanks for the list, will add it to my favorite resources.

    José Luis Chávez del Cid — January 21, 2010 9:27 PM
  5. Marcel Wijnands avatar

    Nice.

    Isn't there a page on MSDN with this list? Including explanantion on what it does and what you should do where?

    If not, you should make it happen, misfitgeek!

    Marcel Wijnands — January 21, 2010 10:05 PM
  6. Ricardo Peres avatar

    You can find a somewhat more complete list here: weblogs.asp.net/.../asp-net-events.

    Ricardo Peres — January 22, 2010 5:24 AM
  7. Marcel Wijnands  avatar

    You guys should add very important missing event ReloadIEifCrashed.

    Marcel Wijnands — January 22, 2010 8:19 AM
  8. Joe Stagner avatar

    Marcel - You may be the first person to post sarcasm AND have the courage to include a real link back !

    I'm so impressed I'm actually going to submit your feature request. (Though I can't guarantee it makes it in to the next version :) )

    Joe Stagner — January 22, 2010 8:26 AM
  9. Kourosh Saleh avatar

    Hi,

    Thank you for this useful blog, But I have a question, what if you use MasterPage and a base class for your web forms?

    Thank again

    Kourosh Saleh — January 22, 2010 8:45 AM
  10. Joe Stagner avatar

    HI Kourosh,

    What do you mean ?

    -Joe

    Joe Stagner — January 22, 2010 8:57 AM
  11. Gene avatar

    Great post Joe.

    But one thing that I am concerned about is where session lives. The docs say, in v2 of ASP.Net, that session should be available in the Init functions in the next release of ASP.Net. I checked, in v4 of ASP.Net, and tested a page, but session is still not available in Init functions. Guess the softies miss that one, I know I was disappointed.

    Gene — January 22, 2010 11:10 AM
  12. Claudio Friederich avatar

    It would be great to see a similar list for controls, including specific lists for the various base classes of controls, including when an in what order data binding related events occur.

    Also, a suggestion for a future version: controls cannot use IsPostBack to determine first-time initialization or event logistics, such as these lists, the way pages can. For controls, this is determined instead by whether they are being created for the first time or reconstituted from view state. Even on post back, controls can be newly created (i.e. templated controls may choose to bind and instantiate templates on a postback). But there is no property that reveals this. So, I suggest an IsReload property for controls. While one can override LoadControlState, and set a flag there, to do that oneself, this is an impediment to beginning ASP.NET developers who want to use usercontrols.

    Claudio Friederich — January 22, 2010 2:57 PM
  13. sushith avatar

    Please explain indepth about the events

    sushith — January 22, 2010 8:25 PM
  14. Toner avatar

    great list

    Toner — January 23, 2010 12:05 PM
  15. Marcel Wijnands avatar

    Joe - OMG I didn't post that. (my e-mail probably doesn't match, as you see the avatar is not the same) It's funny though..

    Marcel Wijnands — January 23, 2010 10:13 PM
  16. David avatar

    ok, what is new ?

    David — January 24, 2010 1:20 PM
  17. Atul Pansare avatar

    Thanks for the great list

    Atul Pansare — January 24, 2010 11:55 PM
  18. Christian Schiffer avatar

    Great post, this is a very importent list to keep in mind while working with asp.net, usercontrols and webcontrols.

    Christian Schiffer — January 25, 2010 3:47 AM
  19. Derrick Valderama avatar

    nice blog..

    Derrick Valderama — January 25, 2010 7:14 PM
  20. Gregory Fequiere avatar

    awesome.

    joe - that would've been nice if you can provide examples for each one them during the page life cycle.

    Gregory Fequiere — January 26, 2010 4:09 PM
  21. Hamid n.CH avatar

    Hello, How are you?

    I'm from Iran.

    I know that you are not interested in Iran

    But, I want to learn Asp.Net More.

    However, Can you Help me?

    Thanks again.

    Hamid n.CH — January 27, 2010 6:44 AM
  22. Joe Stagner avatar

    Hi Hamid,

    In fact, I'm very interested in Iran and have many friend in your country. I'll email you !

    -Joe

    Joe Stagner — January 27, 2010 8:07 AM
  23. Ed avatar

    Joe,

    This is good, but now you need to fold in all the events that get included with data binding. I've just spent a large amount of time hassling with that. Apparently MSDN is wrong when it indicates that Databinding events for controls happen before the Page PreRender events. It's more like Page.PreRender, mycontrol.Databinding, mycontrol.DataBound, mycontrol.PreRender. Might seem esoteric, but it was critical today...

    Ed — January 27, 2010 6:14 PM
  24. Hamid Nezamivand Chegini avatar

    Hi,Mr Joe.

    An error occurred during the compilation of web pages that to prevent to display my web page.

    With this message in statusbar:

    \\C:\Windows\System32\Shdoclc.dll/dnserror

    Thank you very much.

    Hamid Nezamivand Chegini — January 28, 2010 3:21 AM
  25. Muthu avatar

    Great Post to understand ASP.Net Page Life Cycle!

    For more information follow the link msdn.microsoft.com/.../aa479007.aspx

    Muthu — January 28, 2010 8:47 AM

Comments are closed