This question is locked. New answers and comments are not allowed.
Hi,
I have a databound listbox with 10 list items. Out of the 10 items, let's say items 5,7,9 are checked. Is there a way to find out the index of the checked items? In other words, I need to get the values 5,7,9 and pass in to the next page so that I can pull up the info from the DB. There is an indexof property on the checkeditems, but that only returns the index of the items within the checked items collections. In my case the values will be 0,1,2 since I have three items in the checkeditems collection.
Really appreciate some help on this matter.
thanks.
I have a databound listbox with 10 list items. Out of the 10 items, let's say items 5,7,9 are checked. Is there a way to find out the index of the checked items? In other words, I need to get the values 5,7,9 and pass in to the next page so that I can pull up the info from the DB. There is an indexof property on the checkeditems, but that only returns the index of the items within the checked items collections. In my case the values will be 0,1,2 since I have three items in the checkeditems collection.
foreach
(
object
checkedItem
in
lstLoans.CheckedItems)
{
queryString += (cnt == 1 ?
"?"
:
"&"
) +
"loan"
+ cnt +
"="
+ lstLoans.CheckedItems.IndexOf(checkedItem);
cnt += 1;
}
Really appreciate some help on this matter.
thanks.