天天看點

日志不說謊--Asp.net的生命周期

為了學習Asp.net的生命周期,我做了兩個試驗,記錄下了日志,大家先看日志,我有問題:

試驗1:頁面上有一個ClientCallBack的功能;下面記錄的是頁面載入之後點選按鈕執行ClientCallback

2007-11-05 09:16:04,203 [3448] Info ASP.test_aspx - Asp.net生命周期研究--Page_PageInit

2007-11-05 09:16:06,687 [3448] Info ASP.test_aspx - Asp.net生命周期研究--Page_Init

2007-11-05 09:16:06,687 [3448] Info ASP.test_aspx - Asp.net生命周期研究--Page_InitComplete

2007-11-05 09:16:06,687 [3448] Info ASP.test_aspx - Asp.net生命周期研究--Page_PreLoad

2007-11-05 09:16:06,687 [3448] Info ASP.test_aspx - Asp.net生命周期研究--Page_Load

2007-11-05 09:16:15,250 [3448] Info ASP.test_aspx - Asp.net生命周期研究--Page_LoadComplete

2007-11-05 09:16:15,250 [3448] Info ASP.test_aspx - Asp.net生命周期研究--Page_PreRender

2007-11-05 09:16:15,265 [3448] Info ASP.test_aspx - Asp.net生命周期研究--Page_SaveStateComplete

2007-11-05 09:16:15,343 [3448] Info ASP.test_aspx - Asp.net生命周期研究--Page_Unload

2007-11-05 09:28:34,015 [3724] Info ASP.test_aspx - Asp.net生命周期研究--Page_PageInit

2007-11-05 09:28:36,078 [3724] Info ASP.test_aspx - Asp.net生命周期研究--Page_Init

2007-11-05 09:28:36,078 [3724] Info ASP.test_aspx - Asp.net生命周期研究--Page_InitComplete

2007-11-05 09:28:36,109 [3724] Info ASP.test_aspx - Asp.net生命周期研究--Page_PreLoad

2007-11-05 09:28:36,109 [3724] Info ASP.test_aspx - Asp.net生命周期研究--Page_Load

2007-11-05 09:28:36,109 [3724] Info ASP.test_aspx - [Asp.net+控件生命周期]--Page.IsCallback=true;

2007-11-05 09:28:36,109 [3724] Info ASP.test_aspx - [Asp.net+控件生命周期]--Page.IsPostBack=true;

2007-11-05 09:28:37,015 [3724] Info ASP.test_aspx - Asp.net生命周期研究--Page_LoadComplete

2007-11-05 09:28:37,015 [3724] Info ASP.test_aspx - Asp.net生命周期研究--RaiseCallbackEvent();

2007-11-05 09:28:37,015 [3724] Info ASP.test_aspx - Asp.net生命周期研究--GetCallbackResult()

2007-11-05 09:28:37,015 [3724] Info ASP.test_aspx - Asp.net生命周期研究--Page_Unload

試驗2:頁面上有一個UpdatePanel,裡面放了一個按鈕;頁面載入之後點選按鈕TestButton

2007-11-05 09:07:11,312 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_PreInit

2007-11-05 09:07:11,312 [3448] Info UserControl - 控件生命周期--Page_Init

2007-11-05 09:07:11,312 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_Init

2007-11-05 09:07:11,312 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_InitComplete

2007-11-05 09:07:11,312 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_PreLoad

2007-11-05 09:07:11,312 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_Load

2007-11-05 09:07:11,640 [3448] Info UserControl - 控件生命周期--Page_Load

2007-11-05 09:07:11,640 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_LoadComplete

2007-11-05 09:07:11,640 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_PreRender

2007-11-05 09:07:11,640 [3448] Info UserControl - 控件生命周期--Page_PreRender

2007-11-05 09:07:11,640 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_SaveStateComplete

2007-11-05 09:07:11,734 [3448] Info UserControl - 控件生命周期--Page_Unload

2007-11-05 09:07:11,734 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_Unload

2007-11-05 09:07:27,046 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_PreInit

2007-11-05 09:07:27,046 [3448] Info UserControl - 控件生命周期--Page_Init

2007-11-05 09:07:27,046 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_Init

2007-11-05 09:07:27,046 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_InitComplete

2007-11-05 09:07:27,046 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_PreLoad

2007-11-05 09:07:27,046 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_Load

2007-11-05 09:07:27,046 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page.IsPostBack=true;

2007-11-05 09:07:27,109 [3448] Info UserControl - 控件生命周期--Page_Load

2007-11-05 09:07:27,109 [3448] Info ASP.default_aspx - [首頁+控件生命周期]-- TestButton_Click()

2007-11-05 09:07:27,109 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_LoadComplete

2007-11-05 09:07:27,109 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_PreRender

2007-11-05 09:07:27,171 [3448] Info UserControl - 控件生命周期--Page_PreRender

2007-11-05 09:07:27,171 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_SaveStateComplete

2007-11-05 09:07:27,171 [3448] Info UserControl - 控件生命周期--Page_Unload

2007-11-05 09:07:27,171 [3448] Info ASP.default_aspx - [首頁+控件生命周期]--Page_Unload

  不知道大家看到問題了沒有,為什麼ClentCallBack的時候,Page.IsPostBack=true;???

繼續閱讀