RadWindow OnClientClose not working

7 posts, 0 answers
  1. Baris
    Baris avatar
    5 posts
    Member since:
    May 2011

    Posted 20 May 2011 Link to this post

    I am using radwindowmanager on my master page and my other aspx pages are showing radwindows using this manager. except one aspx page, everything is working as expected. on this problematic page i have nothing different, I have the radwindow shown but the bloody OnClientClose event is not working! On other pages when i delete the OnClientClose function on javascript code, it gives me the event is not defined error as normal. but on the problematic page when i delete the OnClientClose, it doesnt even give an error. 

    function confirm(text) {
                 var oManager = GetRadWindowManager();
                 var oWnd = oManager.open(null, "RadWindow6");

    <telerik:RadWindow ID="RadWindow6" runat="server" Animation="None" Behavior="Default"
                    InitialBehavior="None" Left="" Modal="True" NavigateUrl="~/popups/ConfirmWindow.aspx" OnClientClose="OnClientClose"
                    Overlay="True" Top="" VisibleStatusbar="False" Width="360px" Skin="WebBlue" Behaviors="Move,Close" >

    and here's the script that is added to a close button on the ConfirmWindow.aspx page which is inside this radwindow (works and closes the window as expected) :

    function CloseWindow(type) {
            var oWnd = GetRadWindow();
            var oArg = new Object();
            oArg.result = false;
            oArg.type = type;

    the javascript func is opening radwindow and my close button is closing the window but OnClientClose is not working, not even seeked! What am I missing?
  2. Gimmik
    Gimmik avatar
    170 posts
    Member since:
    May 2011

    Posted 20 May 2011 Link to this post

    Do you have a javascript function called "OnClientClosed"? Does it get fired?

  3. Baris
    Baris avatar
    5 posts
    Member since:
    May 2011

    Posted 20 May 2011 Link to this post

    yes I have : "but on the problematic page when i delete the OnClientClose function, it doesnt even give an error. " which means my radwindow doesnt seek an OnClientClose function when it is closed on that specific aspx page. it works and fires the function on other pages. I must be missing sth.. I am desperately examining the code line by line but it looks same as my other aspx pages.

    btw Gimmik, the topic is only about my OnClientClose function not firing and you're asking me if its firing.interesting =)
  4. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 24 May 2011 Link to this post

    Hi guys,

    To be fair, a function that is not working and a function that is not fired at all are 2 different scenarios in many cases :)

    Anyway, when you say that the function is not working, I assume that even if you add a standard alert in that function, it is not fired at all, is that so? If yes, you most probably have a second RadWindowManager on that page. In such case, you need to take into consideration the following:

       1. All RadWindowManager's functions (radopen, radalert, radconfirm, radprompt, GetRadWindowManager, etc) are always using the first rendered RadWindowManager on the page.
       2. Every RadWindowManager "knows" only the RadWindows that are declared in its Windows collection.

    This means that if you have a RadWindow2 as a standalone control OR declared in RadWindowManager2, and you use something like radopen(myUrl, "RadWindow2");, radopen will use RadWindowManager1 and will open a new RadWindow with the settings taken from RadWindowManager1.
    To avoid that problem, when you have multiple managers on a page, you need to get a reference to the correct RadWindowManager first and then call its methods.
    var manager = $find("<%= RadWindowManager2.ClientID %>");
    manager.open(myUrl, "RadWindow2");   

    I hope this information helps. If it doesn't, please open a support ticket and send me the code for the masterpage and the problematic content one, so I could check them.

    Georgi Tunev
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  5. Baris
    Baris avatar
    5 posts
    Member since:
    May 2011

    Posted 25 May 2011 Link to this post

    I found the problem and second radwindowmanager wasnt the cause as I dont have a second.
    Here I draw a picture of my scenario (this new paint is funny =) ) http://img189.imageshack.us/img189/3250/unledqze.png

    my aspx and ascx were both implementing OnClientClose functions but the problematic page was my aspx. I found out that the radwindow on my aspx was triggering the OnClientClose func on ascx as I am using the same RadWindow on both pages.

    I feel stupid not to think of this before.. 
  6. Salik
    Salik avatar
    1 posts
    Member since:
    Jul 2015

    Posted 31 Jul 2015 in reply to Georgi Tunev Link to this post

    Thank You (y) first point helped Me
  7. Ninos
    Ninos avatar
    1 posts
    Member since:
    Jun 2017

    Posted 19 Jun 2017 Link to this post

    Guys, I can't find a solution to my problem related to OnClientClose not triggering.

    1. i don't have more than one RadWindowManager.

    2. I don't have more than one listener to OnClientClose, like explained by Baris.

    3. I have it as simple as the example here, http://docs.telerik.com/devtools/aspnet-ajax/controls/window/client-side-programming/events/onclientclose


    Below is what I have, and when the call oWnd.close() is made the onEulaClose is not fired.

    Any help will be appreciated.


    EULA.aspx (Called page by Default):

    <script type="text/javascript">

    function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow;
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                return oWindow;

            function DoAccept() {
                var oWnd = GetRadWindow();


    <asp:Button ID="btn_close" runat="server" Text="I Accept" OnClick="DoAccept_Click" />


    The code behind DoAccept_Click, eventually calls back into Javascript's function DoAccept()


    Default.aspx (Calling page):


    <script type="text/javascript">

        function onEulaClose(sender, args) {
                alert('got here');

            function displayEULAMessage() {
                var oWnd = radopen("/EULA.aspx", "eulaWin");

         function setBehaviors(oWnd) {


    <telerik:RadWindowManager ID="rwm1" runat="server">

                  <telerik:RadWindow ID="eulaWin"    RenderMode="Lightweight" runat="server" Behaviors="None"        KeepInScreenBounds="true" Skin="WebBlue" EnableEmbeddedSkins="false" IconUrl="" 
           Height="550px" Width="800px" Modal="true" BorderStyle="None" ShowContentDuringLoad="false" ReloadOnShow="false" VisibleStatusbar="false" Title="EULA" 




Back to Top