Misfit Geek

Fustrated by Design !

MaximumASP

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:

Comments

There are 30 comments for this post.

  1. Unwinding the page lifecycle events : Misfit Geek on January 21, 2010 7:38 pm

    RE: Unwinding the page lifecycle events

    Pingback from Unwinding the page lifecycle events : Misfit Geek

  2. jdn on January 21, 2010 8:15 pm

    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.

  3. Twitter Trackbacks for Unwinding the page lifecycle events : Misfit Geek [misfitgeek.com] on Topsy.com on January 21, 2010 8:19 pm

    RE: Unwinding the page lifecycle events

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

  4. RACK on January 21, 2010 8:34 pm

    It is great

  5. Unwinding the page lifecycle events | I love .NET! on January 21, 2010 8:37 pm

    RE: Unwinding the page lifecycle events

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

  6. cutie on January 21, 2010 8:38 pm

    interested

  7. José Luis Chávez del Cid on January 21, 2010 9:27 pm

    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.

  8. Marcel Wijnands on January 21, 2010 10:05 pm

    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!

  9. Ricardo Peres on January 22, 2010 5:24 am

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

  10. Marcel Wijnands on January 22, 2010 8:19 am

    You guys should add very important missing event ReloadIEifCrashed.

  11. Joe Stagner on January 22, 2010 8:26 am

    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 :) )

  12. Kourosh Saleh on January 22, 2010 8:45 am

    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

  13. Joe Stagner on January 22, 2010 8:57 am

    HI Kourosh,

    What do you mean ?

    -Joe

  14. Gene on January 22, 2010 11:10 am

    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.

  15. Claudio Friederich on January 22, 2010 2:57 pm

    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.

  16. sushith on January 22, 2010 8:25 pm

    Please explain indepth about the events

  17. Toner on January 23, 2010 12:05 pm

    great list

  18. Marcel Wijnands on January 23, 2010 10:13 pm

    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..

  19. David on January 24, 2010 1:20 pm

    ok, what is new ?

  20. Atul Pansare on January 24, 2010 11:55 pm

    Thanks for the great list

  21. Christian Schiffer on January 25, 2010 3:47 am

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

  22. Derrick Valderama on January 25, 2010 7:14 pm

    nice blog..

  23. Gregory Fequiere on January 26, 2010 4:09 pm

    awesome.

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

  24. links for 2010-01-26 on January 27, 2010 12:06 am

    RE: Unwinding the page lifecycle events

    links for 2010-01-26

  25. Hamid n.CH on January 27, 2010 6:44 am

    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.

  26. Joe Stagner on January 27, 2010 8:07 am

    Hi Hamid,

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

    -Joe

  27. Today's Bookmarks (Jan 27 2010) on January 27, 2010 5:41 pm

    RE: Unwinding the page lifecycle events

    Today’s Bookmarks (Jan 27 2010)

  28. Ed on January 27, 2010 6:14 pm

    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…

  29. Hamid Nezamivand Chegini on January 28, 2010 3:21 am

    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.

  30. Muthu on January 28, 2010 8:47 am

    Great Post to understand ASP.Net Page Life Cycle!

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

Write a Comment

Let me know what you think?