Reputation: 6577
How to get the parent page name of the modal popup dialog? I have one page that is using in two or more pages by using modal popup. When the close button of the modal popup dialog window, it will redirect to the orgin. But where from we will get the parent page name by programmatically?
Upvotes: 1
Views: 582
Reputation: 14906
As David says, you can use window.opener to get the page that opened a popup window.
However, if you're using a ModalPopupExtender from the AJAX Control Toolkit then you'll likely already be on that page, in which case you'd need to hook up something to the OnOkScript or OnCancelScript attributes of the extender to refresh the page.
If you could post some code it'll make it easier to offer a solution.
Upvotes: 0
Reputation: 129802
You can get a reference to the parent from javascripts window.opener
object, if the current window was indeed opened in a popup/modal dialog.
Upvotes: 3