我想提出一些带有多选单选按钮的数据列表视图的问题,以便如何从列表中获取每个问题的答案或检查单选按钮值?
答案 0 :(得分:0)
protected void btnSave_Click(object sender, EventArgs e)
{
foreach (RepeaterItem item in Repeater1.Items)
{
// Checking the item is a data item
if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
{
var rdbList = item.FindControl("RadioButtonList1") as RadioButtonList;
// Get the selected value
string selected = rdbList.SelectedValue;
}
}
}
试试这个让我知道