简体   繁体   English

限制访问其他打开的浏览器

[英]Restricting access to the other open browser

I have requirement where I need to open a popup on click of a button. 我要求在单击按钮时需要打开弹出窗口的地方。 This works fine, but the pop up window goes behind the opened browser. 这可以正常工作,但弹出窗口位于打开的浏览器后面。 I want to restrict access to the other opened browser window until the complete transaction in the newly opened window is done. 我想限制对另一个打开的浏览器窗口的访问,直到在新打开的窗口中完成交易为止。

In order to open a new window I am using the following code. 为了打开一个新窗口,我使用以下代码。

Response.Write("detailedresults=window.open('NewWindow.aspx','Send Data','left=(screen.width) ? (screen.width - 800) / 2 : 0,top=(screen.height) ? (screen.height - 700) / 2 : 0, width=1000, height=500, toolbar=no, menubar=no, titlebar=no, location=no, addressbar=no');"); Response.Write(“ detailedresults = window.open('NewWindow.aspx','Send Data','left =(screen.width)?(screen.width-800)/ 2:0,top =(screen.height) ?(screen.height-700)/ 2:0,宽度= 1000,高度= 500,工具栏=否,菜单栏=否,标题栏=否,位置=否,地址栏=否');“);

I would use a modal dialog for this instead of a popup. 我将为此使用模式对话框而不是弹出窗口。 One, modal dialogs are less intrusive to other tabs that might be open, and two, they typically include a semi-transparent overlay layer covering the main window to restrict access as you requested. 一是模态对话框对其他可能打开的选项卡的干扰较小,二是它们通常包括覆盖主窗口的半透明覆盖层,以按您的要求限制访问。 Here is an example from jQuery UI: 这是jQuery UI的示例:

http://jqueryui.com/dialog/#modal-confirmation http://jqueryui.com/dialog/#modal-confirmation

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM