Friday, February 1, 2008

Opening a Pop-Up Window

//Add this to the Page_Load() ...

Button_ToOpenPopupWindow.Attributes.Add ("onclick", "window.open ('PopUp_WindowToOpen.aspx', null, 'height=600, width=460, status= yes, resizable= no, scrollbars=no, toolbar=no, location=no, menubar=no, minimize=no '); ");


-
ShriKrishna Bhardwaj , With ASP.Net, SQL Server, Javascript

1 comment:

Unknown said...

this scriptlet is not only usful in popping up a window, you can collect information through it as a dialog box by makin it a model and assigning result to a variable in this way until you close the dialog you can't access the main window.
e.g.

var sImgSrc = showModalDialog("picuploader.aspx","","font-family:Verdana; font-size:12; dialogWidth:30em; dialogHeight:34em" );


a new pop up window can be opened anywhere by putting the code given below

window.open ('PopUp_WindowToOpen.aspx', null, 'height=600, width=460, status= yes, resizable= no, scrollbars=no, toolbar=no, location=no, menubar=no, minimize=no ');