This is a migrated thread and some comments may be shown as answers.
radwindow onclientclose question
1 Answer 33 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Steven asked on 21 Jan 2012, 12:07 AM

Kinda new to telerik.

I have a page with a windowmanager, radwindow, and a customcontrol on it.

the customcontrol uses javascript to open the control on the parent page like so

function UseRadWindowOnParentPage(DialogURL,RadWindowID, Width, Height, Title, argument) {
    var oManager = GetRadWindowManager();
    var oWnd = oManager.GetWindowByName(RadWindowID);
    oWnd.SetSize(Width, Height);
    oWnd.argument = argument;
    oWnd.OnClientClose = function () {
        alert('client close');



oWnd.OnClientClose never fires.
Any idea whats going on?

If i set the OnClientClose property in the radwindow control it works. The radwindow is used several times and not everything is supposed to have a onclientclose event.

I know I could add a radwindow for every popup I need but I got it this far and would prefer to reuse 1 radwindow rather than adding 6 radwindows where the only real difference is the OnClientClose so far, most everything I have tried from this link works.




1 Answer, 1 is accepted

Sort by
Marin Bratanov
Telerik team
answered on 23 Jan 2012, 04:41 PM
Hello Steven,

Let me start with pointing you to the current documentation for the RadControls for ASP.NET AJAX, as the link you pasted if from the old, "Classic" suite's documentation which is no longer supported. Here begins the current version: and here the RadWindow's:

Now, to your questions - attaching event handlers via JavaScritp is done via an explicit method, which is described here: Please keep in mind that if you reuse the same window adding handler more than once will naturally result in it being called multiple times. What you can do to avoid this is to remove the handler in the OnClientClose event handler itself.

 An alternative solution is to declare two different RadWindows - one with the hander and one without it (or any other different configurations you may need) and use the one you need. You may find useful this article on the different ways to open a RadWindow:

Yet another option is to set the DestroyOnClose property of the manager to true so that each RadWIndow is disposed when it is closed. This will make sure you create a new instance each time and it will have only one handler attached (you can attach it only if need be, a simple if statement).

I would also advise that you examine the current client-side API of the RadWindow here:

Kind regards,
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Asked by
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question