2010-05-03 24 views
0

我的ASP.NET表單包含一個在Page_Load事件處理程序中創建並配置的動態創建的單選按鈕的集合。是否有一個ASP.NET事件發生在回發後,但在頁面被銷燬/重新創建之前?

通常情況下,我處理在Page_Load處理回傳數據,使用條件:

if (IsPostBack) 

但是,因爲我需要訪問的控制是在Page_Load處理程序創建的,從以前的渲染回傳數據的頁面丟失。爲了更好地說明問題,這裏是事件的輪廓,因爲它們發生:
1-Page_Load is invoked for the first time
2-An unknown number of radiobuttons are created dynamically
3-The radiobuttons are configured, based on information present on the server
4-The radiobuttons are added to the page's content
5-The user selects an option, and clicks the submit button
6-The Page_Load handler is invoked for the second time
7-The radio-buttons are added dynamically, exactly as before
8-The radio-button that the user checked is seemingly non-existant for processing

好像我需要在不同的事件h中處理這個不同的部分andlers。是否有回發後發生的事件,但原始單選按鈕仍可訪問?

+0

覆蓋的OnInit(),並有創建單選按鈕列表。然後,他們將在整個回發期間訪問。 – 2010-05-03 23:07:09

+0

您可以在** init **中構建您的控制結構嗎? – R0MANARMY 2010-05-03 23:07:31

回答

相關問題