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

asp.net生命周期

系統 2291 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生命周期


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

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

【本文對您有幫助就好】

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

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 四虎在线视频 | 中文字幕在线一区二区在线 | 久久国产乱子伦精品免费看 | 麻豆久久精品免费看国产 | 五月婷婷激情网 | 亚洲瑟瑟网 | 婷婷色综合久久 | 九九热免费在线观看 | 国产成人精品亚洲日本在线观看 | 亚欧在线免费观看 | 91精品国产免费久久久久久青草 | 中文字幕人成不卡一区 | 98色花堂国产精品首页 | 亚洲欧美一区二区三区 | 手机看片日韩日韩 | 亚洲日本久久一区二区va | 国语自产偷拍精品视频偷最新 | 成人日韩精品 | 四虎免费观看 | 一区二区三区欧美在线 | 亚洲精品一区二区久久 | 欧美人zoxxxx另类 | 亚洲精品成人一区 | 高清一区二区亚洲欧美日韩 | 日本色色网 | 国产做人爱三级视频在线 | 四虎影院在线免费播放 | 国产精品入口麻豆 | 久热996re这里有精品 | www夜夜操| 欧美成人在线免费视频 | 我要看欧美一级毛片 | 国产伦一区二区三区四区久久 | 狠狠干b | 人成午夜免费大片在线观看 | 国内精品一区视频在线播放 | 五月婷婷综合激情网 | 伊人久热这里只有精品视频99 | 一级爱 | 中国欧美日韩一区二区三区 | 中文字幕日本一区波多野不卡 |