The life cycle of Web page is detailed

Source: Internet
Author: User
Understanding the life cycle of an ASP. NET Web page is necessary for a web development engineer, especially when writing your own control.

The life cycle of an ASP. NET Web page can be basically divided into the following phases:

1. Page Request
This page is requested when an ASP occurs before the Web page life cycle when there is a page being requested. NET engine to determine if the page needs to be compiled or sent directly to the requestor via the buffered version of the page.

2. Start
At this stage, the page's Request,response,ispostback,uiculture property is set appropriately.

3. Page Initialization
At this stage, the UniqueID property of each control is set and the theme of the page is applied, and if this page is a callback page, that is, the page's IsPostBack property is true, then the new values and viewstate of the controls on the pages are not restored at this stage.

4. Load
At this stage, if the page is a callback page, the new values and viewstate for each control in the selected page will be restored or set.

5. Validation
At this stage, the validation control in the page calls its own validate method for validation to set its own IsValid property, because the validation control is validated on both the client and the server side.

6. Postback Event Handling
All of the delegate events at this stage will be called, and all of our event-handling code is called at this time.

7. Rendering
At this stage, the page invokes the Render method of each control to write the HTML text flow for each control to the OutputStream property of response, before which each control will save its own viewstate again. So we have one last chance to change the ViewState property of the control in the page's PreRender method.

8. Unload
At this stage, the entities that were created for the page and each control are deleted and the resource is freed.
  • Related Article

    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.