I’m using this jquery multiselect control on an asp.net webforms page. Here is the code:
<script type="text/javascript">
$(document).ready(function () {
$(".multiselect").multiselect();
});
</script>
<asp:listbox runat="server" CssClass="multiselect">
<asp:ListItem Value="1">foo</asp:ListItem>
<asp:ListItem Value="2">bar</asp:ListItem>
</asp:listbox>
<asp:Button runat="server" Text="save" OnClick="SaveClick"/>
My SaveClick event is empty, so only a postback is being performed. If I select both items in my multiselect dropdown, and then click submit, only the last item is selected. I found one similar issue here, but it doesn’t seem to apply to asp.net. Anyone figured this one out?
I forgot to set SelectionMode=”Multiple”