Wednesday, April 15, 2015

asp.net Javascript/jQuery: Set Values (Selection) in a multiple Select

1) <asp:ListBox ID="lbWork" runat="server" SelectionMode="Multiple" CssClass="fullwidth "></asp:ListBox>

2)     $.each(data[0].Work.split(","), function (i, e) {
                         
                            $("#<%=lbWork.ClientID%> option[value='" + e + "']").prop("selected", true);
                        });

No comments:

Post a Comment