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 Responses to ASP.Net UserControl Life Cycle in DesignMode

  1. […] ASP.Net UserControl Life Cycle in DesignMode […]

  2. […] ASP.Net UserControl Life Cycle in DesignMode […]

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: