branch is of checkbox list type, but while looping through this it adds only one item while i want to store all "li" in branch_id and want to retrive later why it's not adding all in branch_is. is there any other option which can add all this to variable branch_id.
foreach (ListItem li in branch.Items)
{
if(li.Selected)
{
List<int> branch_id = new List<int>();
branch_id.Add(Convert.ToInt32(li.Value));
}
}