CheckBoxList
StringBuilder sbEquipment = new StringBuilder();
foreach (ListItem li in chklEquipment.Items)
{
if (li.Selected)
{
sbEquipment.AppendFormat("{0}|", li.Text);
}
}
if (sbEquipment.Length > 1)
{
sbEquipment.Remove(sbEquipment.Length - 1, 1);
}
//string strEquipment = String.Empty;
string[] arrEquipment = strEquipment.Split(new char[] { '|' });
foreach (ListItem li in chklEquipment.Items)
{
foreach (string str in arrEquipment)
{
if (li.Text.Equals(str))
{
li.Selected = true;
break;
}
}
}