如何关闭当前浏览器窗口并重定向到previously打开的窗口为同一个浏览器 [英] How to close current Browser window and redirect to a previously opened window for the same browser

查看:147
本文介绍了如何关闭当前浏览器窗口并重定向到previously打开的窗口为同一个浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个ASP页,第一个是家里第二个是测试。在主页上,用户可以选择他们想要占用测试类型,经过pressing启动按钮,一个新的窗口,为您开放,参加考试。我想要实现的是,在完成测试后,我要关闭测试窗口,并重定向到另一个页面,而这个重定向页面应该打previously打开家里的窗口。

i have two asp page,first one is home and second one is test. In home page user can select the type of test they want to take up, and after pressing start button a new window is open for taking the test. What i want to achieve is , after completing the test i want to close the test window and redirect to another page, and this redirect should hit the previously opened home window.

推荐答案

您不澄清,你有我正在为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

问候....:)

这篇关于如何关闭当前浏览器窗口并重定向到previously打开的窗口为同一个浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆