protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
{
string a = string.Empty;
foreach (ListItem li in CheckBoxList1.Items)
{
if (li.Selected == true)
{
a += li.ToString() + ",";
}
}
a = a.TrimEnd(',');
TextBox1.Text = a;
}
The order of the item is not maintained. When I deselect any item from checkbox all items rearragens starting from the first item of checkbox. I want the orderj of selection to be maintanined on deselection.
Thanks.