Friday, September 28, 2007

Control Hierarchy

Below is the explanation of - How Control are loaded and initialized along with the Page life Cycle.

Note- This all happens before the 'Init' phase of the Page Life Cycle. i.e It happens in the 'Initialization' phase.

Imagine you have an ASP.NET Web page with the following HTML portion:

When this page is first visited, a class will be autogenerated that contains code to programmatically build up the control hierarchy. The control hierarchy for this example can be seen as below.

This control hierarchy is then converted to code that is similar to the following:

When the control hierarchy is constructed, the properties that are explicitly set in the declarative syntax of the Web control are assigned in the code. (For example, the Button Web control has its Text property set to "Submit!" in the declarative syntax – Text="Submit!" – as well as in the autogenerated class—Button1.Text = "Submit!";.

Arun Manglick

No comments:

Post a Comment