获取浏览器当前打开的URL选项卡 [英] get the URL currently open tab of browser

查看:196
本文介绍了获取浏览器当前打开的URL选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个Web应用程序,在其中使用window.print()函数来打印报告.

当我单击打印"按钮时,将打开一个新标签页(url = chrome://print/).
我希望当用户不打印此报告时,必须显示该报告,并且当用户打印该报告或取消该报告时,用户将被重定向到主页.

意味着打印完成后,用户将被重定向到主页.

Hi,

I have a web application in which I used window.print() function for printing the report.

When I clicked on print button a new tab will open (url=chrome://print/).
I want that while the user does not print this report, the report must show, and when user prints the report or cancels the report, user is redirected to home page.

means, when the printing is done, the user will be redirected to home page.

推荐答案

您可以在javascript
中使用"document.location.href"
继续编码
you can use "document.location.href" in javascript

keep coding


试试这个

Try this one

string url = HttpContext.Current.Request.Url.AbsoluteUri;
// http://localhost:1302/TESTERS/Default6.aspx


这篇关于获取浏览器当前打开的URL选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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