我想知道关于ASP.NET页面生命周期 [英] I want to know that about ASP.NET page Life cycle

查看:79
本文介绍了我想知道关于ASP.NET页面生命周期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道关于ASP.NET页面生命周期

I want to know that about ASP.NET page Life cycle

推荐答案

我推荐这些链接到batter了解ASP.NET页面生命周期



http://www.codeguru.com/csharp/.net/net_asp/article.php/c19393/The-ASPNET-Page-Life-Cycle.htm [ ^ ] < br $>


了解ASP.NET代码示例中的页面生命周期 - Runnable [ ^ ]



https://www.mindstick.com/bl og / 48 / asp-dot-net-page-life-cycle [ ^ ]



ASP.NET页面生命周期 [ ^ ]
I recommended these link to batter understand ASP.NET Page Life Cycle

http://www.codeguru.com/csharp/.net/net_asp/article.php/c19393/The-ASPNET-Page-Life-Cycle.htm[^]

Understanding the Page Life Cycle in ASP.NET Code Example - Runnable[^]

https://www.mindstick.com/blog/48/asp-dot-net-page-life-cycle[^]

ASP.NET Page Life Cycle[^]


以下是一般的ASp.NET页面生命周期

1.页面请求:页面请求发生在页面生命周期开始之前

2.开始:在开始阶段,设置页面属性,如请求和响应

3.初始化:页面初始化期间,页面上的控件可用,并且每个控件的UniqueID属性都已设置

4.加载:在加载期间,如果当前请求是回发,则控制属性将加载从视图状态和控制状态恢复的信息。

5. PostBack:如果请求是回发,控件事件处理程序被称为

6.渲染:在渲染之前,为页面和所有控件保存视图状态。

7.卸载:Unload事件在页面已完全呈现。
Following are the general ASp.NET Page life cycle
1. Page request : The page request occurs before the page life cycle begins
2. Start : In the start stage, page properties such as Request and Response are set
3. Initialization : During page initialization, controls on the page are available and each control's UniqueID property is set
4. Load : During load, if the current request is a postback, control properties are loaded with information recovered from view state and control state.
5. PostBack : If the request is a postback, control event handlers are called
6. Rendering : Before rendering, view state is saved for the page and all controls.
7. Unload : The Unload event is raised after the page has been fully rendered.


Following are the page life cycle events:

PreInit - PreInit is the first event in page life cycle. It checks the IsPostBack property and determines whether the page is a postback. It sets the themes and master pages, creates dynamic controls, and gets and sets profile property values. This event can be handled by overloading the OnPreInit method or creating a Page_PreInit handler.

Init - Init event initializes the control property and the control tree is built. This event can be handled by overloading the OnInit method or creating a Page_Init handler.

InitComplete - InitComplete event allows tracking of view state. All the controls turn on view-state tracking.

LoadViewState - LoadViewState event allows loading view state information into the controls.

LoadPostData - During this phase, the contents of all the input fields are defined with the <form> tag are processed.

PreLoad - PreLoad occurs before the post back data is loaded in the controls. This event can be handled by overloading the OnPreLoad method or creating a Page_PreLoad handler.

Load - The Load event is raised for the page first and then recursively for all child controls. The controls in the control tree are created. This event can be handled by overloading the OnLoad method or creating a Page_Load handler.

LoadComplete - The loading process is completed, control event handlers are run, and page validation takes place. This event can be handled by overloading the OnLoadComplete method or creating a Page_LoadComplete handler

PreRender - The PreRender event occurs just before the output is rendered. By handling this event, pages and controls can perform any updates before the output is rendered.

PreRenderComplete - As the PreRender event is recursively fired for all child controls, this event ensures the completion of the pre-rendering phase.

SaveStateComplete - State of control on the page is saved. Personalization, control state and view state information is saved. The HTML markup is generated. This stage can be handled by overriding the Render method or creating a Page_Render handler.

UnLoad - The UnLoad phase is the last phase of the page life cycle. It raises the UnLoad event for all controls recursively and lastly for the page itself. Final cleanup is done and all resources and references, such as database connections, are freed. This event can be handled by modifying the OnUnLoad method or creating a Page_UnLoad handler.


这篇关于我想知道关于ASP.NET页面生命周期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆