亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

asp.net生命周期

系統(tǒng) 2717 0

Page Event

Typical Use

PreInit

Use this event for the following:

  • Check the IsPostBack property to determine whether this is the first time the page is being processed.

  • Create or re-create dynamic controls.

  • Set a master page dynamically.

  • Set the Theme property dynamically.

  • Read or set profile property values.

    ms178472.alert_note(en-us,VS.90).gif Note:
    If the request is a postback, the values of the controls have not yet been restored from view state. If you set a control property at this stage, its value might be overwritten in the next event.

Init

Raised after all controls have been initialized and any skin settings have been applied. Use this event to read or initialize control properties.

InitComplete

Raised by the Page object. Use this event for processing tasks that require all initialization be complete.

PreLoad

Use this event if you need to perform processing on your page or control before the Load event.

Before the Page instance raises this event, it loads view state for itself and all controls, and then processes any postback data included with the Request instance.

Load

The Page calls the OnLoad event method on the Page , then recursively does the same for each child control, which does the same for each of its child controls until the page and all controls are loaded.

Use the OnLoad event method to set properties in controls and establish database connections.

Control events

Use these events to handle specific control events, such as a Button control's Click event or a TextBox control's TextChanged event.

ms178472.alert_note(en-us,VS.90).gif Note:
In a postback request, if the page contains validator controls, check the IsValid property of the Page and of individual validation controls before performing any processing.

LoadComplete

Use this event for tasks that require that all other controls on the page be loaded.

PreRender

Before this event occurs:

The PreRender event occurs for each control on the page. Use the event to make final changes to the contents of the page or its controls.

SaveStateComplete

Before this event occurs, ViewState has been saved for the page and for all controls. Any changes to the page or controls at this point will be ignored.

Use this event perform tasks that require view state to be saved, but that do not make any changes to controls.

Render

This is not an event; instead, at this stage of processing, the Page object calls this method on each control. All ASP.NET Web server controls have a Render method that writes out the control's markup that is sent to the browser.

If you create a custom control, you typically override this method to output the control's markup. However, if your custom control incorporates only standard ASP.NET Web server controls and no custom markup, you do not need to override the Render method. For more information, see Developing Custom ASP.NET Server Controls .

A user control (an .ascx file) automatically incorporates rendering, so you do not need to explicitly render the control in code.

Unload

This event occurs for each control and then for the page. In controls, use this event to do final cleanup for specific controls, such as closing control-specific database connections.

For the page itself, use this event to do final cleanup work, such as closing open files and database connections, or finishing up logging or other request-specific tasks.

ms178472.alert_note(en-us,VS.90).gif Note:
During the unload stage, the page and its controls have been rendered, so you cannot make further changes to the response stream. If you attempt to call a method such as the Response.Write method, the page will throw an exception.

asp.net生命周期


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 羞羞色院91 | 欧美一级艳片爽快片 | 亚洲高清在线观看看片 | aaa级片| 欧美高清成人 | 亚洲国产精品一区二区久久hs | 草草在线观看视频 | 成人毛片国产a | 午夜时刻免费实验区观看 | 在线成人亚洲 | 顶级欧美色妇xxxxbbbb | 亚洲国产男人本色在线观看的a站 | 97精品视频共享总站 | 欧美日韩乱码毛片免费观看 | 成年女人在线观看片免费视频 | 色国产精品 | 欧洲成人全免费视频网站 | 亚洲羞羞视频 | 美女毛片免费 | 久久一色本道亚洲 | 成人深夜网站 | 97在线观看免费视频 | 国产精品免费观看网站 | 精品久久伊人 | 国产精品免费网站 | www干| 免费视频爰爱太爽了 | 国产精品美女流白浆视频 | 操人网站 | 激情综合五月亚洲婷婷 | 久久性生活片 | 免费99精品国产自在现线观看 | 色婷婷亚洲十月十月色天 | 亚洲欧美国产视频 | 精品久久久久久久久久久久久久久 | 国产精品香蕉成人网在线观看 | 亚洲品质自拍视频 | 日本一区二区精品 | 国产精品久久久久久久久夜色 | 激情五月开心婷婷 | 国产在线观看一区二区三区四区 |