Need help in listbox multiple select
- by vaibhav
I have a list box, filled with countries. A user can select multiple countries in the list box.
<asp:ListBox ID="lstRegion" style="width: 115px;size:3px" runat="server"
onselectedindexchanged="lstRegion_SelectedIndexChanged" SelectionMode="Multiple" >
<asp:ListItem Text="Please Select" Value="" Selected="True"></asp:ListItem>
</asp:ListBox>
I need all the selected values in the list box. I am using lstRegion.selectedValue but it is giving me only one value.
I tried a different soultion, run a loop to the count of items in the lstRegion and find if the particular item has been selected or not. But this solution does'nt look good for me.
Can any one suggest me how to get all selectedvalues in the list box