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

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條評論
主站蜘蛛池模板: 国内精品视频成人一区二区 | 久久vs国产综合色大全 | 高清不卡一区二区三区 | 亚洲国产激情在线一区 | 亚洲毛片在线观看 | 亚洲资源站资源网在线 | 91论坛在线| 久久国产精品99久久久久久老狼 | 青草视频网址 | 日本成人中文字幕 | 日本欧美高清 | 99riav视频| 久久久亚洲欧洲国产 | 欧美深度肠交惨叫 | 天天干天天爽天天射 | 免费看一级毛片 | 国产亚洲精品久久久久91网站 | 久久亚洲精品中文字幕亚瑟 | 成人网影| 哪个网站能看毛片 | 亚洲+自拍+色综合图区一 | 99精品久久99久久久久久 | 久久青草免费91线频观看不卡 | 玖玖国产精品 | 九九精品视频在线播放 | 久久精品2| 天天曰天天干 | 亚洲国产一级a毛片 | 国产一级特黄aa级特黄裸毛片 | 色花堂国产精品第二页 | 9re视频这里只有精品 | 久久久久久午夜精品 | 老子影院午夜伦不卡亚洲 | 四虎一影院区永久精品 | 一区二区免费看 | 亚洲日韩精品欧美一区二区 | 欧美一级夜夜爽 视频 | 免费一级片视频 | 九九久久精品国产 | 国产精品成人麻豆专区 | 五月天婷五月天综合网在线 |