Jquery Chosen选择不在asp列表框上工作

时间:2013-07-11 08:49:01

标签: c# jquery asp.net jquery-chosen

我在列表框中使用Jquery Chosen Plugin来选择多个项目。但是当我检索selected项时,它确实有效,所选项目的数量仍为0.

这就是我应用控件的方式:

<script type="text/javascript">
     function pageLoad(sender, args) {
            $('#<%= this.listBox.ClientID%>').chosen();
        }
</script>

<asp:Panel ID="pnlAddUpdate" runat="server">
  <asp:UpdatePanel ID="updpAddUpdate" runat="server" UpdateMode="Conditional">
     <asp:ListBox ID="listBox" runat="server" SelectionMode="Multiple"></asp:ListBox>
  </asp:UpdatePanel>
</asp:Panel>

这是我的代码隐藏:

foreach (ListItem item in this.listBox)
    {
        if (item.Selected)
            list.Add(Convert.ToInt32(item.Value));
    }

列表仍然是空的..不知道我错过了什么?

0 个答案:

没有答案