asp.net RadioButtonList 的保存与绑定,好心人帮忙

来源:百度知道 编辑:UC知道 时间:2024/04/29 23:01:01
有N组RadioButtonList . 我用string a = radio_1.selectedvalue.trim()+radio_2.selectedvalue.trim()+radio_2..........
把这几个RadioButtonList 的结果保存在一个字段里结果是:N102N112N20
N:因没选而为空的 0:是 1:否 2:一般
问题是:我怎么才能通过一个循环跟据字符串的值来设置相对应的RadioButtonList
大哥要是有空.CheckBoxList 我也有同样的问题

这个可以不?
for (int i = 0; i < Page.Controls.Count; i++)
{
foreach (System.Web.UI.Control control in Page.Controls[i].Controls)
{
if (control is RadioButtonList)
{
if (String.IsNullOrEmpty((control as RadioButtonList).SelectedValue))
{

}
else
{

}
}
}

}