请教,我想在后台页面test.aspx.cs中动态添加radioButton并赋予数据库中的值,怎么写?是这样吗?
public void AddRadio()
{
DataTable dt=TestBll.GetDate(""); //这行有数据啊
RadioButtonList rb = new RadioButtonList();
for(int i=0;i<dt.Rows.Count;i++)
{
rb.Items.Add(i.ToString,dt.Rows[i]["area"].ToString());
}
}这样写的话,在test.aspx页面能显示吗?好像不能啊?
在test.aspx上该怎样处理啊?怎样才能显示在aspx页面上啊
public void AddRadio()
{
DataTable dt=TestBll.GetDate(""); //这行有数据啊
RadioButtonList rb = new RadioButtonList();
for(int i=0;i<dt.Rows.Count;i++)
{
rb.Items.Add(i.ToString,dt.Rows[i]["area"].ToString());
}
}这样写的话,在test.aspx页面能显示吗?好像不能啊?
在test.aspx上该怎样处理啊?怎样才能显示在aspx页面上啊
你要个容器来装你的ridao啊?