I am doing a pop up on my home page using the following link
<a href="CreateUser.a开发者_JAVA百科spx" 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.
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
}
}
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
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.
I think you want to use a Modal, not a popup window.
- ASP.NET Modal Example
- What's a Modal Window?
精彩评论