我在页面中有4个radiobuttonlist,它们是在占位符中动态添加的。我必须检查代码隐藏中radiobuttonlist中选择了哪个选项。所有控件都添加到placeholder.Html中的面板中,如下所示:
neo4j
答案 0 :(得分:0)
假设这是一个aspx页面,请尝试遍历面板的控件,如:
foreach(var control in yourPanel.Controls)
{
try
{
var radioButtonList = (RadioButtonList)control;
foreach(var item in radioButtonList.Items)
{
// something like
var selected = item.Selected;
// or whatever code fits your needs
}
}
catch
{
continue;
}
}