Value in Select2 multi select

1

Good afternoon,

I'm having difficulty returning the values of N items selected with select2, it returns only the first. I'm using ASP.NET.

<asp:DropDownList ID="ddlMeses" runat="server" 
                  class="js-example-basic-multiple menorselect2"
                  onchange="todos()" 
                  multiple="true"> 
    <asp:ListItem Value="13">Todos os meses</asp:ListItem> 
    <asp:ListItem Value="1">Jan</asp:ListItem> 
    <asp:ListItem Value="12">Dez</asp:ListItem> 
</asp:DropDownList>

Dim listOfValues AS List(Of String) = new List(Of String)
        For Each item As ListItem In ddLokasi.Items
            If item.Selected Then
                listOfValues.Add(item.Value)
            End If
        Next
    
asked by anonymous 07.03.2017 / 15:53

0 answers