我的ASP.NET窗体包含在页面加载事件处理程序中创建和配置的动态创建的单选按钮集合。
通常,我在页面加载处理程序中处理回发数据,使用以下条件:
if (IsPostBack)
但是,由于我需要访问的控件是在页面加载处理程序中创建的,因此来自页面上一次呈现的回发数据将丢失。为了更好地说明问题,以下是事件发生时的概要:
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
似乎我需要在不同的事件处理程序中处理这一点的不同部分。是否有回发后发生的事件,但原始的单选按钮仍然可以访问?