0

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.

Oskar Kjellin
  • 21,280
  • 10
  • 54
  • 93
rookie
  • 401
  • 3
  • 13
  • 29
  • 1
    possible duplicate of [How can I create a pop-up window using a new page as the pop-up source?](http://stackoverflow.com/questions/7218158/how-can-i-create-a-pop-up-window-using-a-new-page-as-the-pop-up-source) – Daniel A. White Aug 29 '11 at 13:54
  • you can always search a bit here in SO for similar questions :) http://stackoverflow.com/questions/3937591/window-open-as-modal-popup – Davide Piras Aug 29 '11 at 13:55
  • Seems like you want to create a modal popup. You can use the ModalPopup extension of the Ajax Control Toolkit for this purpose. You can find a demo here: http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/modalpopup/modalpopup.aspx – Christophe Geers Aug 29 '11 at 13:57

4 Answers4

0

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
    }
}
James Johnson
  • 45,496
  • 8
  • 73
  • 110
0

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

Community
  • 1
  • 1
akonsu
  • 28,824
  • 33
  • 119
  • 194
0

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.

Alex Text
  • 269
  • 1
  • 4
  • 11
  • 1
    Why are popups a bad idea, and what are the many problems that they cause? Could you please elaborate on that statement? – James Johnson Aug 30 '11 at 14:07
0

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

Jack Marchetti
  • 15,536
  • 14
  • 81
  • 117