Groupname for Radiobutton not working

G

Guest

I have a Web Control Table and I am adding Radio buttons programatically. but
when the page is displayed groupname doesn't seem to work. I can select
multiple radio buttons....

code snippet...
TableRow aRow = new TableRow();
for (int i=0;i<5;i++)
{
TableCell cell1 = new TableCell();
RadioButton aRadio = new RadioButton();
aRadio.ID = "Radio" + i.;
aRadio.Text = options.ToString();
aRadio.GroupName = "Radio";
cell1.Controls.Add(aRadio);
aRow.Cells.Add(cell1)
}
 
D

Daniel Walzenbach

Did you have a look for the html that is actually rendered? This might help
you to trace down the error.

Regards

Daniel Walzenbach
 
G

Guest

:(

I had to add the name through attribute.add("name",somename), and it workd.



Daniel Walzenbach said:
Did you have a look for the html that is actually rendered? This might help
you to trace down the error.

Regards

Daniel Walzenbach


dotnettester said:
I have a Web Control Table and I am adding Radio buttons programatically.
but
when the page is displayed groupname doesn't seem to work. I can select
multiple radio buttons....

code snippet...
TableRow aRow = new TableRow();
for (int i=0;i<5;i++)
{
TableCell cell1 = new TableCell();
RadioButton aRadio = new RadioButton();
aRadio.ID = "Radio" + i.;
aRadio.Text = options.ToString();
aRadio.GroupName = "Radio";
cell1.Controls.Add(aRadio);
aRow.Cells.Add(cell1)
}

 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top