且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何关闭当前浏览器窗口并重定向到previously打开的窗口为同一个浏览器

更新时间:2022-11-18 12:06:28

您不澄清,你有我正在为aspecting在弹出的弹出窗口或空白窗口
在点击提交按钮preSS

You don't clarify that you have popup window or blank window i am aspecting for the popup In submit click button press

String x = "<script type='text/javascript'>window.opener.location.href='**Your new url of new page after completing test**';self.close();</script>";
ScriptManager.RegisterClientScriptBlock(this.Page,this.Page.GetType(), "script", x,false);

自关闭您将可以关闭当前窗口,并通过 window.opener.location.href 您将能够重定向到新的URL
我希望这会帮助你。

From self close you will be able to close current window and by window.opener.location.href you will able to redirect to new url I hope this will help you

问候....:)