我需要在我的表中創建動態單選按鈕。我在default.aspx(id = table1)中有一個表,但在.cs中我不訪問table1這是第一個問題。如果我能達到它,我想創建動態單選按鈕列表。例如,我想創建8個單選按鈕列表,其中有5個成員。我想我用foreach塊做這個。我發現這個代碼示例:ASP.net創建動態單選按鈕列表
foreach (?)
{
RadioButton radioButton = new RadioButton();
radioButton.Text = answer.Text;
radioButton.GroupName = question.Id.ToString();
radioButton.ID = question.Id + "_" + answer.Id;
TableRow answerRow = new TableRow();
TableCell answerCell = new TableCell();
TableCell emptyCell = new TableCell();
emptyCell.ColumnSpan = 2;
answerCell.Controls.Add(radioButton);
answerRow.Cells.Add(emptyCell);
answerRow.Cells.Add(answerCell);
table.Rows.Add(answerRow);
}
但我不知道actuallu.thanks回答...
不知您是否可以向我們展示相關的aspx標記? – 2012-02-09 08:16:54