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

Is it possible to execute JS after close radalert window?

1 Answer 146 Views
Window
This is a migrated thread and some comments may be shown as answers.
Fakhrul
Top achievements
Rank 1
Fakhrul asked on 15 Mar 2009, 07:05 AM
Hi,

Is it possible to execute JavaScript after close/click on radalert window?
if possible, please provide with some sample code.

Thanks

Fakhrul

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 16 Mar 2009, 08:05 AM
Hello Fakhrul,

Yes, this is possible - you need to get a reference to the radalert object and then use the ASP.NET AJAX add_close() function to hook to its close event:

<form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
 
    <script type="text/javascript"
        function callAlert() 
        { 
            //get a reference to the radalert object 
            var oWnd = radalert("radalert text");  
            //add a closing function to it 
            oWnd.add_close(closingFn);  
        } 
         
        function closingFn() 
        { 
            //execute your code 
            alert("closed"); 
        } 
    </script> 
 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
    </telerik:RadWindowManager> 
    <button onclick="callAlert(); return false;"
        call radalert</button> 
</form> 


Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
Fakhrul
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or