The page will be activated in the following order:
Page. preinit
Page. init
Page. initcomplite
Page. Preload
Page. Load
Page. loadcomplete
Page. prerender
Page. prerendercomplete
If the page inherits from another page, such as basepage: system. web. UI. page, some extensions are made in the basepage, such as permission check. When other pages inherit from the basepage, the order of activation of the events of the basepage and the final page is:
Ui. preinit
Page. preinit
Ui. init
Page. init
Ui. initcomplite
Page. initcomplite
Ui. Preload
Page. Preload
Ui. Load
Page. Load
Ui. loadcomplete
Page. loadcomplete
Ui. prerender
Page. prerender
Ui. prerendercomplete
Page. prerendercomplete
If masterpage is used, the events in masterpage and those in contentpage are activated in the following order:
Contentpage. preinit
Master. init
Contentpage. init
Contentpage. initcomplite
Contentpage. Preload
Contentpage. Load
Master. Load
Contentpage. loadcomplete
Contentpage. prerender
Master. prerender
Contentpage. prerendercomplete
Furthermore, if contentpage inherits the basepage, the execution sequence of each event is changed:
Ui. preinit
Contentpage. preinit
Master. init
Ui. init
Contentpage. init
Ui. initcomplite
Contentpage. initcomplite
Ui. Preload
Contentpage. Preload
Ui. Load
Contentpage. Load
Master. Load
Ui. loadcomplete
Contentpage. loadcomplete
Ui. prerender
Contentpage. prerender
Master. prerender
Ui. prerendercomplete
Contentpage. prerendercomplete
I did not find the Asp.net 1.1 I have learned now. It is estimated that it should be Asp.net 2.0,
But it does not matter, which makes me know the order in which they are loaded during inheritance.
That is, the inherited page is loaded first. If the inherited page has an inherited page, the inherited page is loaded first.
It is actually a very simple content. Write down the page event by the way (I don't know if 1.1 is the case)
event processor name |
occurrence time |
page_init |
load and initialize the Server Control in the view State of the web form. This is the first step in the web form lifecycle |
page_load |
load the server control on the page object. The view status information can be used at this time, therefore, Code can be used to modify the space settings or display text on the page. |
page_prerender |
the application Program will present the Page Object |
page_unload |
the page is detached from the memory |
page_error |
An unhandled exception |
page_aborttransaction |
transaction processing terminated |
page_committransaction |
transaction processing accepted |
page_databinding |
bind the server space and data source on the page |
page_disposed |
the Page Object is released from the memory. This is the last event in the lifecycle of the Page Object |