This is a migrated thread and some comments may be shown as answers.

Hooking Window.Close & Redirecting Page Behind

2 Answers 194 Views
Window
This is a migrated thread and some comments may be shown as answers.
James Simm
Top achievements
Rank 1
James Simm asked on 07 Jan 2008, 11:03 AM
Hi there,
The page I'm currently building loads a Prometheus Window with content from an external domain, on which there is a button (over which I have no control) which calls window.close when clicked.

I realise this doesn't close the Prometheus Window, but is there any way to hook the window.close event, and make it call the necessary commands to close the window.

Also, is there a way to detect the window closing event, as I need to redirect the page once this window is closed.

Thanks very much for any information!
James Simm


2 Answers, 1 is accepted

Sort by
0
James Simm
Top achievements
Rank 1
answered on 07 Jan 2008, 11:45 AM
Update: ignore the bit about redirecting the page behind. I've got around that problem.

However, if anyone has a useful way to hook the window.close call to close the radwindow, please reply!

Thanks in advance,
James Simm
0
Georgi Tunev
Telerik team
answered on 07 Jan 2008, 02:41 PM
Hi James,

If the page is on a different site, the browser's security engine will not allow you to capture commands called from there - e.g. you will not be able to detect from your page that window.close() is called in the other page.

If you have access to that external page and you can modify the code for that button I can give you a code that will check if the page is opened in a RadWindow or in a standard browser's popup and call specific commands depending on that condition- e.g. window.close() or GetRadWindow.Close. Then you can hook to the OnClientClose event of the RadWindow and do the redirection there.



Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
James Simm
Top achievements
Rank 1
Answers by
James Simm
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or