ASP. NET Page Life Cycle

Source: Internet
Author: User

Normal page lifecycle stage:

Generally, the lifecycle of a common page goes through the following stages. The application phase occurs both before and after. For more information, see application lifecycle.

1. Page request

Description: a page request occurs before the page lifecycle. When the page is requested by the user, asp.net determines whether to parse and compile the page, or whether a page with memory version can be returned without running the page.

2. Start:

Description: In the start step, page attributes such as request and response are set. In this phase, the page determines whether postback or a new request is required and sets the ispostback attribute. In addition, the uiculture attribute of the page is set.

3. Page initialization:

Description: The control is available during initialization and the UniqueID attribute of each control is set. All page themes are also applied. If the current request is a secondary request (postback), The postback data is not loaded and the properties of the control cannot be read and assigned from the viewstate.

4. Load:

Description: if the current request is postback during loading, the control property is restored from viewstate and control status information.

5. Verification:

Description: The verification methods for all the isVaild attributes and independent verification controls on the page are called.

6. postback event handling:

Description: If it is postback, handler calls all events.

7. Rendering:

Description: Before rendering, viewstate saves the page and all controls. At this stage, the page calls the Render method of each control and provides a text writer to write the outputStream of the response attribute of the page.

8. Uninstall:

Description: When the page is completely displayed, it is returned to the client and the preparation is abandoned. At this time, the page's response and request attributes are uninstalled and cleared.

 

Asp.net page events:

1 page_preInit

2 page_Init

3 page_InitComplete

4 page_PreLoad

5 page_Load

Control events

6 page_LoadComplete

7 page_SaveStateComplete

8 page_Render

9 page_Unload

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.