複数選択ラジオボタンを備えたデータリストビューでいくつかの質問をしたいので、リストから各質問の回答またはチェックされたラジオボタンの値を取得するにはどうすればよいですか?
1 に答える
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;
}
}
}
これを試して、私に知らせてください
于 2013-08-23T06:11:47.597 に答える