While adding items from one CheckBoxList to another CheckBoxList how to check if the item is already present in the second CheckBoxList using asp.net c#
The code I have written to move between CheckBoxLists is:
protected void add_Click(object sender, EventArgs e)
{
for (int i = 0; i <= CheckBoxList2.Items.Count - 1; i++)
{
if (CheckBoxList2.Items[i].Selected)
{
CheckBoxList3.Items.Add(CheckBoxList2.Items[i]);
CheckBoxList3.ClearSelection();
}
}
}
I am using add_Click button to move items between lists.
I need to validate while adding items.
Kindly help. Thank you..!!
This will work :-