jQuery UI Multiple Select在母版页的内容的.aspx页中不起作用 [英] jQuery UI Multiple Select not working in .aspx page that is content for a master page

查看:99
本文介绍了jQuery UI Multiple Select在母版页的内容的.aspx页中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用此jquery插件( http://www .erichynds.com/jquery/jquery-ui-multiselect-widget/)在具有许多不同gridview的aspx页面上.页面代码位于asp:content标记内.我将选择选项放在asp:gridview之外的asp:view中.该页面使用母版页.我的多选小部件在空白页面上工作,但是无法使其与我的母版页面一起使用.我试过在使用它的gridview中添加css/script links/document.ready().我尝试使用母版上的asp:contentplaceholder和aspx页中的单独asp:content标签将其添加到母版页的首页标签中.我一辈子都无法将多选功能带到小部件的用户界面上.

I'm trying to use this jquery plugin (http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/) on an aspx page with many different gridviews. The page code is within an asp:content tag. I'm placing my select options in an asp:view outside of an asp:gridview. The page uses a master page. I have the multiselect widget working in a blank page, but I can't get it to work with my master page. I've tried adding my css/script links/document.ready() in the gridview I'm using it with. I've tried adding it to the head tag of the master page using an asp:contentplaceholder on the master and a separate asp:content tag in my aspx page. I can't for the life of me get the multiselect to take on the UI of the widget.

我已经在空白页面上看到了工作部件,jquery添加了一个按钮,并在跨距中添加了用于设置multiselect样式的类.在我的aspx页面中,这些项目没有添加.

I've noticed on the blank page with the working widget, the jquery adds a button and a couple spans with the classes needed to style the multiselect. In my aspx page, these items do not get added.

<button type="button" class="ui-multiselect ui-widget ui-state-default ui-corner-all" 
aria-haspopup="true" style="width: 240.60000002384186px;">
<span class="ui-icon ui-icon-triangle-2-n-s"></span><span>5 selected</span></button>


//My Code
<link rel="Stylesheet" type="text/css" href="../Styles/jquery-ui-1.9.1.custom.min.css" />
<link rel="stylesheet" href="../Styles/jquery.multiselect.css" type="text/css" />
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="../Scripts/jquery-ui-1.9.1.custom.min.js" type="text/javascript"></script>
<script src="../Scripts/jquery.multiselect.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#example").multiselect({
            minWidth: 235
        });
        $("#example").multiselect("checkAll");
    });
</script>

<select id="example" name="example" multiple="multiple">
            <option value="1">Option 1</option>
            <option value="2">Option 2</option>
            <option value="3">Option 3</option>
            <option value="4">Option 4</option>
            <option value="5">Option 5</option>
</select>

我尝试删除母版页中的所有其他CSS/脚本引用,但没有用.还有其他可能会冲突的东西吗?

I've tried removing all other css/script references in the master page and that didn't work. Is there something else that might be conflicting?

推荐答案

我以错误的顺序加载了脚本.

I was loading my scripts in the wrong order.

这篇关于jQuery UI Multiple Select在母版页的内容的.aspx页中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆