I have a radwindow which is opened using a javascript function as follows. However, when the radwindow pops up, the alert is displayed.

function OpenRadWindow() 
{
   var oManager = GetRadWindowManager();
   var oMailWnd;
   oMailWnd = window.radopen("MyModal.aspx");
   oMailWnd.set_title("Modal Window");
   oMailWnd.OnClientClose = HideActions();
   oMailWnd.set_modal(true);
}

function HideActions() {
   alert("Window Closed");
}

I have not been able to find anywhere that sets OnClientClose inside javascript. Could someone tell how to do this?

link|flag

1 Answer

This line:

oMailWnd.OnClientClose = HideActions();

is wrong. If you want to add a closing handler to the RadWindow object, you should use the client-side API

e.g.

oMailWnd.add_close(HideActions);

Also, if you are going to show the window multiple times and you haven't set DestroyOnClose=true, I would suggest to clear the closing handler in the closing function in order to avoid stacking:

function HideActions(sender) {
//remove the handler
sender.remove_close(HideActions);
//your code 
alert("Window Closed");

}

link|flag

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.