I have a following code:
foreach (ListItem item in lstCreate.Items)
{
if (item.Selected)
strCreateNewVideoCategory += item.Value + ":0,";
else
strCreateNewVideoCategory += item.Value + ":1,";
}
Am using this procedure,item.Selected is false every time,even when am selecting an item from the list of items.what am i doing wrong?
Note: ListItem using a user control (ascx).
You must try with this code for binding
Because you load and bind your control every time that you post, so you erase the selected value
Use the ViewState in order to persist.