我使用 jQueryDialogue 和 Iframe 在当前页面内弹出外部 url 页面
var iframe = $('<iframe frameborder="0" id="FrameCust" marginwidth="0" marginheight="0" allowfullscreen></iframe>');
var dialog = $("<div id='tempstep'></div>").append(iframe).appendTo("body").dialog({
autoOpen: false,
modal: true,
resizable: false,
width: "auto",
height: "auto",
close: function () {
iframe.attr("src", "");
}
});
$("input[id$='btnAddCust']").on("click", function AddCust(e) {
e.preventDefault();
var src = "../MasterPages/CustomerMaster.aspx?lpopup=True";
var title = "Customer Master";
var width = "980";
var height = "530";
iframe.attr({
width: +width,
height: +height,
src: src
});
dialog.dialog("option", "title", title).dialog("open");
});
在我的客户主代码隐藏文件中检查查询字符串以识别弹出窗口或本身的页面(lpopup='True') 我想在单击 PopupDialogue 内的“保存”按钮后关闭 PopupDialogue(在外部 URL 中) 我该怎么做?
最佳答案
您可以使用下面的代码从弹出页面的代码后面传递父页面中的查询字符串。这也将关闭弹出窗口。
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "jain", "<script type='text/javascript' language='javascript'>parent.location.replace('../test.aspx?Q=123456');</script>");
关于c# - 使用 Iframe 关闭 PopupJqueryDialogue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18029676/