jQuery bootstrap multiselect下拉列表没有加载

时间:2015-04-02 10:29:16

标签: c# jquery asp.net twitter-bootstrap

我正在尝试在我的一个ASPX页面中使用bootstrap multiselect插件。除了multiselect插件,我在同一页面中有几个其他jQuery控件(如自动完成文本框等)和一些客户端验证。以下是我的bootstrap multiselect代码:

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> 

    <link href="Styles/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link href="Styles/StyleSheetMasterDataForm.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="Styles/bootstrap-3.1.1.min.css" type="text/css" />
<link rel="stylesheet" href="Styles/bootstrap-multiselect.css" type="text/css" /> 

   <script src="Scripts/jquery-1.11.2.js" type="text/javascript"></script>
   <script type="text/javascript" src="Scripts/bootstrap-2.3.2.min.js"></script>
<script type="text/javascript" src="Scripts/bootstrap-multiselect.js"></script>
    <script src="Scripts/jquery-ui.js" type="text/javascript"></script>  
    <script src="Scripts/jquery-ui.min.js" type="text/javascript"></script>   



    <script language="JavaScript" type="text/JavaScript">
        $(document).ready(function () {            
          debugger;
           $("[id*=ListBoxProdEngine]").multiselect({
                includeSelectAllOption: true
            });
 });                     //Ending document.ready
    </script>

HTML code:

<tr>
              <td class="style6"><div class="style8"><strong>Product Engine:</strong></div></td>

              <td class="style2"><asp:ListBox ID="ListBoxProdEngine" multiple="multiple" runat="server"></asp:ListBox></td>
            </tr>

代码背后:

private void PopulateProductEngine()
        {
            try
            {
                ProductEngine objProductEngine = new ProductEngine();
                ListBoxProdEngine.DataSource = objProductEngine.GetProductEngine();
                ListBoxProdEngine.DataTextField = "ProductEngine";
                ListBoxProdEngine.DataValueField = "ProductEngine";
                ListBoxProdEngine.DataBind();
            }
            catch (Exception ex)
            {
                ErrorHandler.ReportError(ex); //Notifies technical team about the error
                Server.ClearError();
                Response.Redirect(string.Format("Error.aspx?aspxerrorpath={0}", Request.Url.PathAndQuery));
            }
        }

遇到的错误发生在&#34; multiselect&#34; document.ready中的函数。请帮忙。

0 个答案:

没有答案