我正在使用iframe加载另一个.aspx(ParentPage.aspx)页面的.aspx(ChildPage.aspx)页面 . 我在ChildPage中使用jquery UI自动完成控件时遇到问题 . 问题是子页面下显示的自动完成结果 .

在这里,您可以在“MMMM”项目之后,其他项目在页面后面 . 我需要在页面上方显示它 . 所以我会看到其他可用的项目 .

这是ParentPage.aspx .

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind=.................... 
    <!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <!-- JS and CSS files -->
    </head>
    <body>
        <form id="form1" runat="server">
          <!-- Other contents -->
           <div>
              <iframe src="ChildPage.aspx" style="width: 100%; height: 40vh; border: none" name="childPageIframe"></iframe>
           <div>
        </form>
    </body>
    </html>

而ChildPage.aspx是;

<%@ Page Language="C#" AutoEventWireup="true"................

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<!-- JS and CSS files -->

    $("#MYTEXTBOX").autocomplete({
        source: function (request, response) {
            $.ajax({
                url: "../XXXXXX.asmx/ItemAutoComplete",
                type: "POST",
                dataType: "json",
                data: JSON.stringify({
                    keyword: request.term
                }),
                contentType: "application/json; charset=utf-8",
                dataFilter: function (data) { return data; },
                success: function (data) {
                    response($.map(data.d, function (item) {
                        return {
                            label: (item.ItemName),
                            value: (item.item.ItemName),
                            id: item.ItemID
                        };
                    }));
                }
            });
        },
        position: { my: "right top", at: "right bottom" },
        minLength: 2,
        select: function (event, ui) {
           //
        }
    }).focus(function () {
        $(this).autocomplete("search");
    });


</head>

<body>
   <div class="inputRow">
        <label>Item</label>
        <input type="text" id="MYTEXTBOX"/>
   </div>
   <div class="inputRow">
        <label>Qty</label>
        <input type="text" id="Qty" readonly="readonly" clientidmode="Static" runat="server"  />
    </div>
</body>
</html>