This question already has an answer here:
I would like to render a simple list of - Controls. My ASP.NET Code-behind looks like:
RadioButtonList list = new RadioButtonList();
list.ID = rbl.name;
list.CssClass = rbl.cssClass;
foreach (radio radio in rbl.radio)
{
ListItem li = new ListItem();
li.Text = radio.label;
li.Value = radio.value;
li.Selected = radio.@checked;
list.Items.Add(li);
}
But the RadioButtonList renders automatically a HTML-Table. If I use HtmlInputRadioButton everything works fine but it crashes on RenderControl()
Adding to the answer by Rubens Farias, ASP.NET 4 adds two new options to RadioButtonList.RepeatLayout, OrderedList and UnorderedList.
You should take a look into RadioButtonList.RepeatLayout Property