Closing Pop Up.
-
Hi , I am displaying a pop-up on a click of a button in my page. I want to close the pop-up on the click of a certain button in the pop-up as well as want to refresh the parent page as the pop up closes. Plz help. Thanks a ton
Deepak Surana
Look at window.opener
only two letters away from being an asset
-
Look at window.opener
only two letters away from being an asset
-
Hi , I am displaying a pop-up on a click of a button in my page. I want to close the pop-up on the click of a certain button in the pop-up as well as want to refresh the parent page as the pop up closes. Plz help. Thanks a ton
Deepak Surana
Hi, you have to add a attribute to that button during the page load event of the form that would call the popup .the code for that is like: ********************************************** loginButton.Attributes.Add("onclick", "window.showModalDialog('/MyWebsite/login.aspx', null, 'status:no; dialogWidth:360px; dialogHeight:229px; help:no; scroll:no; menubar:no; resizable:no')"); *********************************************** This code is for modalDialog or for popup button.Attributes.Add ("onclick", "javascript: functiontoopenpopup();"); this will open the popup window. In the popupwindow code....on the Page_unload you have to write this code. ***************************************** window.close(); window.opener.location.reload(); ***************************************** This will close the popup and refresh the parent window. Regards, Kaps
-
Thanks a lot. And one more question, how can i show a message saying something like "Saved" and then close the pop up after the user clicks on ok
Deepak Surana