Please look at this code .. this will add the values of all 'checked' boxes
(check box list control) into an array .. the problem is its adding the
values twice.
for eg: If I selected 2, 3 on the page the array is getting values ..
2,2,3,3. It should be getting 2,3. What is the error?
foreach ( ListItem item in LayersCheckBoxList.Items )
{
int j = LayerNameList1.Count ;
if ( item.Selected )
{
for (int i =0; i<j; i++ )
{
if (LayersCheckBoxList.Items[i].Selected)
{
LayerNameList2.Add(LayersCheckBoxList.Items[i]);
}
}
}
}
Any help would be greatly appreciated !
Thanks
Steven