I have an ASP.NET form in which I am using a listbox. I have set the selectionmode property to "Multiple". what i want to do is all the items that are selected from the listbox i want to pass it to a variable with comma as a seprator. But no matter what I select it only passes me the value for the first item in the list box whether its selected or not selected.
Here an example
out of the four items that are selected it will only pass the value of item1 in variable.
here is the code that i am using
For i = 1 To listbox1.Items.Count
If listbox1.Items(i - 1).Selected = True Then
strsub = strsub & "," & listbox1.items(i-1).Text