Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/306.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
C# 使用Iframe关闭PopupJqueryDialogue_C#_Javascript_Jquery_Asp.net - Fatal编程技术网

C# 使用Iframe关闭PopupJqueryDialogue

C# 使用Iframe关闭PopupJqueryDialogue,c#,javascript,jquery,asp.net,C#,Javascript,Jquery,Asp.net,我使用jQueryDialogue和Iframe在当前页面中弹出外部url页面 var iframe = $('<iframe frameborder="0" id="FrameCust" marginwidth="0" marginheight="0" allowfullscreen></iframe>'); var dialog = $("<div id='tempstep'></div>").append(iframe

我使用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");
            });
var-iframe=$('');
var dialog=$(“”).append(iframe.appendTo(“正文”).dialog({
自动打开:错误,
莫代尔:是的,
可调整大小:false,
宽度:“自动”,
高度:“自动”,
关闭:函数(){
iframe.attr(“src”,即“);
}
});
$(“输入[id$='btnAddCust'])。在(“单击”上,函数AddCust(e){
e、 预防默认值();
var src=“../MasterPages/CustomerMaster.aspx?lpopup=True”;
var title=“客户主机”;
var width=“980”;
var height=“530”;
iframe.attr({
宽度:+宽度,
身高:+身高,
src:src
});                    
对话框(“选项”、“标题”、“标题”)。对话框(“打开”);
});
在my customer master Codebehind文件中,检查查询字符串以从弹出窗口或其本身识别页面(lpopup='True') 我想在单击PopupDialogue(在外部Url中)内的Save按钮后关闭PopupDialogue
如何才能做到这一点?

您可以使用下面的代码从弹出页面的代码后面传递父页面中的查询字符串。这也将关闭弹出窗口

 Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "jain", "<script type='text/javascript' language='javascript'>parent.location.replace('../test.aspx?Q=123456');</script>");
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),“jain”,“parent.location.replace(“../test.aspx?Q=123456”);”;

你能为此提供JSFIDLE吗?是的,它可以工作,但它会再次初始化我的页面。实际上,这些弹出窗口用于在计费时添加客户。添加客户后,弹出窗口会自动关闭,并将焦点设置到下一个文本框。但是如果我这样做,用户输入的所有详细信息都会丢失。如果你只想关闭,我如何防止回发弹出窗口,然后在父页面中创建一个javascript函数,以隐藏名为tempstep的div,该div包含iframe。然后从后面的弹出代码调用它。与此类似,Page.ClientScript.RegisterClientScriptBlock(this.GetType(),“test”,“parent.somefunction();”;我正在寻找这些父项。somefunction();非常感谢。