ASP.Net radio button list
Posted
by c11ada
on Stack Overflow
See other posts from Stack Overflow
or by c11ada
Published on 2010-03-21T17:52:00Z
Indexed on
2010/03/21
18:11 UTC
Read the original article
Hit count: 293
ASP.NET
hey all
im trying to create a feedback form, i have a some mock code which looks similar to this
for (int i = 1; i < 3; i++)
{
TableRow tr = new TableRow();
Table1.Rows.Add(tr);
TableCell QuestionCell = new TableCell();
// get the text for the question and stick it in the cell
QuestionCell.Text = "<b>"+i+".</b> Question " + i;
tr.Cells.Add(QuestionCell);
TableRow tr2 = new TableRow();
Table1.Rows.Add(tr2);
// create a cell for the choice
TableCell ChoicesCell = new TableCell();
ChoicesCell.Width = 1000;
// align the choices on the left
ChoicesCell.HorizontalAlign = HorizontalAlign.Left;
tr2.Cells.Add(ChoicesCell);
RadioButtonList rbl = new RadioButtonList();
rbl.ID = "Radio1_" + i;
ChoicesCell.Controls.Add(rbl);
rbl.Items.Add("1");
rbl.Items.Add("2");
rbl.Items.Add("3");
rbl.Items.Add("4");
}
obviously this code doesn't mean anything, its just to experiment on how i can do this feedback form, the problem im having now is once some one presses the submit button (there's a submit button on the form) how do i go through the table and get text from the radio buttons the user has selected ?? the feedback from in created on page_load !!
thanks for any help !!
© Stack Overflow or respective owner