日期:2014-05-17 浏览次数:20571 次
string result = ";1;2;4;";
var list=result.Split(';');
foreach (ListItem item in this.CheckBoxList1.Items)
{
if (list.Contains(item.Value))
item.Selected = true;
}
string str = ";1;2;4;";
string[] arr = str.Substring(1, str.Length - 2).Split(';');
foreach (string obj in arr)
{
for (int i = 0; i < CheckBoxList1.Items.Count; i++)
{
if (obj == CheckBoxList1.Items[i].Value)
{
this.CheckBoxList1.Items[i].Selected = true;
}