Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ajax组合框在jquery对话框中不工作_Jquery_Asp.net_Ajax - Fatal编程技术网

Ajax组合框在jquery对话框中不工作

Ajax组合框在jquery对话框中不工作,jquery,asp.net,ajax,Jquery,Asp.net,Ajax,我在让ajax控件在jquery对话框中工作时遇到问题。下面是我设置的一个简单示例,以显示我的问题。有人能告诉我怎么做吗?先谢谢你。第一部分是页面,第二部分是母版页 <%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApp.WebForm1" %> <%@ Registe

我在让ajax控件在jquery对话框中工作时遇到问题。下面是我设置的一个简单示例,以显示我的问题。有人能告诉我怎么做吗?先谢谢你。第一部分是页面,第二部分是母版页

<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApp.WebForm1" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHeader" runat="server">
<script src="/Scripts/jquery-1.8.2.js" type="text/javascript"></script>
<script src="/Scripts/jquery-ui-1.8.24.js" type="text/javascript"></script>
    <script type="text/javascript">
        function Popup() {
            $('#divcomboboxtest').dialog({
                modal: false,
                minHeight: 170,
                minWidth: 300,
                title: "How do I get the ajax combobox to work here in the popup?"
            });
            $('#divcomboboxtest').parent().appendTo('form');
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphDetail" runat="server">
<table style="width: 620px">
    <tr>
        <td>
            <ajax:ComboBox ID="cbworks" runat="server" Width="150" AutoPostBack="false"
                 DropDownStyle="DropDownList" ToolTip="works here">
                <asp:ListItem Text="this works" Value=""></asp:ListItem>
                <asp:ListItem Text="item 2" Value="2"></asp:ListItem>
            </ajax:ComboBox>
        </td>
    </tr>
    <tr>
        <td>
            <asp:Button ID="btntest" runat="server" UseSubmitBehavior="false" Text="test this" OnClientClick="return Popup();" />
        </td>
    </tr>

</table>
        <asp:Panel ID="pnlcomboboxtest" runat="server" style="display: none">
            <div id="divcomboboxtest">
                                <div>Date:</div>
                                <div>
                                    <ajax:ComboBox ID="acbDate" runat="server" Width="150" 
                                        AutoPostBack="false" DropDownStyle="DropDownList">
                                        <asp:ListItem Text="does not work" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="item 2" Value="2"></asp:ListItem>
                                    </ajax:ComboBox>
                                </div>
                </div>
       </asp:Panel>
</asp:Content>

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="WebApp.Site1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="cphHeader" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
                <asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release">
        </asp:ScriptManager>
    <div>
        <asp:ContentPlaceHolder ID="cphDetail" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

您希望在页面加载时或用户执行某项操作时出现弹出窗口。它是如何不工作的?你用的是什么浏览器?如果使用Internet Explorer,则呈现页面的文档模式是什么?你有脚本错误吗?如果对话框工作正常,则无需将其放入具有display:none样式的面板中。另外,您应该将div附加到表单中,而不是div的父级。我需要在用户单击btntest按钮时出现弹出窗口。当我单击btntest按钮时,它会弹出对话框窗体,然后当我单击下拉按钮时,它不会显示项目。如果在弹出asp:panel时将其删除,则组合框下拉按钮甚至不会出现。有什么想法吗?