如何防止asp:RadioButtonList呈现HTML表? [英] How can I prevent asp:RadioButtonList from rendering a HTML-Table?
本文介绍了如何防止asp:RadioButtonList呈现HTML表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想呈现一个-控件的简单列表.我的ASP.NET后台代码如下:
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);
}
但是RadioButtonList自动呈现HTML表.如果我使用HtmlInputRadioButton,则一切正常,但在RenderControl()上崩溃
But the RadioButtonList renders automatically a HTML-Table. If I use HtmlInputRadioButton everything works fine but it crashes on RenderControl()
推荐答案
查看全文