如何获取DataList中Radiobuttonlist所选项的值?

2024-11-15 10:44:34
推荐回答(1个)
回答1:

for (int i = 0; i < DataList1.Items.Count; i++)
{
RadioButtonlist rb = (RadioButtonlist)DataList1.Items[i].FindControl("RadioButtonlist1");//()内为rb的id
if (rb.selected)
{
// 你要干的事
}
}