ASP.Net UserControl Life Cycle in DesignMode

The ASP.Net Page Life Cycle is described on a couple of blogs such as this detailed description (including achart and code). The description, however, usually deals with the life cycle during runtime.

But what about the design time behavior of compiled user controls?

I took the code from Justin’s Blog (first link) to trace the events triggered in DesignMode, and, after a bit of adjustment, found the following DesignMode life cycle:

Open a page containing the compiled ascx in Visual Studio designer

  • Construct
  • public property setters (for properties set in the ascx)
  • ResolveAdapter
  • OnInit
  • TrackViewState
  • CreateControlCollection

Navigate to the control in designer

  • all public property getters
  • public property setter (as you edit a property value in designer)

Close the page in designer

  • OnUnload

2 thoughts on “ASP.Net UserControl Life Cycle in DesignMode

  1. Pingback: Series: ASP.Net User Control Libraries « devioblog

  2. Pingback: ASP.Net 4 Page Life Cycle « devioblog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.