asp.net c# 中弹出页面

发布于 2024-12-02 07:43:01 字数 373 浏览 0 评论 0原文

我正在使用以下链接在主页上弹出一个窗口,

<a href="CreateUser.aspx" target="_blank"

 onclick="window.open('CreateUser.aspx', 'windowname',

'width=500,height=400,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no'); return false">Create users</a>

但是当打开此窗口时,我可以在主页中导航,我想禁用它,直到用户在创建用户页面中单击“确定”或“取消”。如何做到这一点。

I am doing a pop up on my home page using the following link

<a href="CreateUser.aspx" target="_blank"

 onclick="window.open('CreateUser.aspx', 'windowname',

'width=500,height=400,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no'); return false">Create users</a>

But when this window is opened I am able to navigate in the home page, which I want to disable until user clicks ok or cancel in the create users page. How to do that.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

所有深爱都是秘密 2024-12-09 07:43:01

要禁用您所指的特定方面,我相信您需要将 showMenu 设置为 false。

这是一种方法,其中包括打开弹出窗口时最常用的选项:

openChildWindowWithDimensions = function(url, width, height, showMenu, canResize, showScrollbars) {
    var childWindow = window.open(url, "", "\"width=" + width + ",height=" + height + ",menubar=" + (showMenu ? "1" : "0") + ",scrollbars=" + (showScrollbars ? "1" : "0") + ",resizable=" + (canResize ? "1" : "0") + "\"");
    if (childWindow){
        childWindow.resizeTo(width, height); //for IE9 bug
    }
}

To disable the specific aspect you were referring to, I believe you'd want to set showMenu to false.

Here is a method which includes the most commonly used options when opening a popup window:

openChildWindowWithDimensions = function(url, width, height, showMenu, canResize, showScrollbars) {
    var childWindow = window.open(url, "", "\"width=" + width + ",height=" + height + ",menubar=" + (showMenu ? "1" : "0") + ",scrollbars=" + (showScrollbars ? "1" : "0") + ",resizable=" + (canResize ? "1" : "0") + "\"");
    if (childWindow){
        childWindow.resizeTo(width, height); //for IE9 bug
    }
}
怕倦 2024-12-09 07:43:01

我认为最可靠的方法是使用javascript。互联网上有很多关于如何实现模式弹出窗口的示例。特别是: Div 作为模态 - javascript

I think the most reliable way is to use javascript. There are a lot of examples on the internet on how to implement a modal popup. In particular: Div as modal - javascript

-黛色若梦 2024-12-09 07:43:01

弹出窗口是一个坏主意。它们会产生很多问题。为什么不尝试制作一个div并将弹出窗口的内容放入其中? jQueryUI 可以帮助您: http://jqueryui.com/demos/dialog/ 对于内容,例如,您可以将其嵌入到 ASP.NET 用户控件中。

Pop ups is a bad idea. They produce many problems. Why don't you try to make a div and put the contents of the pop up in it? jQueryUI can help you: http://jqueryui.com/demos/dialog/ And for the content, you can embedd it in a ASP.NET User Control, for example.

勿忘初心 2024-12-09 07:43:01

我认为你想使用模态窗口,而不是弹出窗口。

I think you want to use a Modal, not a popup window.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文