UserControl1.ascx和UserControl2.ascx为先后在Test.aspx中创建的用户控件:
| 执行步骤 | Test.aspx | UserControl1.ascx | UserControl2.ascx |
| 1 | OnInit | ||
| 2 | Init | ||
| 3 | OnInit | ||
| 4 | Init | ||
| 5 | OnInit | ||
| 6 | Init | ||
| 7 | Load | ||
| 8 | Load | ||
| 9 | Load | ||
| 10 | (Buttom_Click...) | (Buttom_Click...) | (Buttom_Click...) |
| 11 | PreRender | ||
| 12 | PreRender | ||
| 13 | PreRender | ||
| 14 | Unload | ||
| 15 | Unload | ||
| 16 | Unload |
- 当Init激发时,控件都已经可用,但控件未通过ViewState对象初始化。
- 在所有控件都通过ViewState对象初始化之后,激发Load