Old code from 2008 Q3 1314 not working in 2009 Q2 826

3 posts, 0 answers
  1. ian webster
    ian webster avatar
    14 posts
    Member since:
    Jan 2006

    Posted 16 Oct 2009 Link to this post


    I've encountered a problem after upgrading from RadControls for ASP.Net AJAX 2008 Q3 1314 to 2009 Q2 826.

    I'm using rad windows and when the user closes one they get a warning in a rad confirm box, if they click ok the window should close if they click cancel it stays.

    This all worked great in the 2008 Q3 release but in the newer 2009 Q2 release when you click ok on the rad confirm box the window doesn't close.

    Here are the scripts I am using to open the windows and to handle the showing on the confirm box:

        function OpenAWindow(url, title) {  
            var win = radopen(url, null);  
            win.add_pageLoad(function() { win.set_status(""); });  
        function OnBeforeClose(sender, arg) {  
            function callbackFunction(arg) {  
                if (arg) {  
                    if (!AnyWindowsVisible()) {  
                        document.getElementById('<%= btnClose.ClientID %>').click();  
            var messageBody = document.getElementById('<%= hdnWarningMessage.ClientID %>').value;  
            var messageTitle = document.getElementById('<%= hdnWarningTitle.ClientID %>').value;  
            radconfirm(messageBody, callbackFunction, 300, 100, null, messageTitle);  
        function AnyWindowsVisible() {  
            var result = false;  
            var manager = GetRadWindowManager();  
            for (var i = 0; i < manager.get_windows().length; i++) {  
                if (manager.get_windows()[i].isVisible()) {  
                    result = true;  
            return result;  
        function OnClientShow(sender) {  
    and the html:

    <asp:UpdatePanel ID="pnlScript" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">  
            <asp:Literal ID="litScriptAnchor" runat="server" /> 
            <asp:HiddenField ID="hdnWarningMessage" runat="server" /> 
            <asp:HiddenField ID="hdnWarningTitle" runat="server" /> 
    <div class="TelerikWindowRestrictedZone_Container">  
        <div class="TelerikWindowRestrictedZone_Header">  
        <div id="WindowContainer" class="TelerikWindowRestrictedZone_Body">  
    <asp:UpdatePanel ID="pnlWindowCommands" runat="server">  
            <asp:Button ID="btnClose" runat="server" Text="close" OnClick="btnClose_Click" Style="display: none;" /> 
    <asp:UpdatePanel ID="pnlWindows" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">  
            <telerik:RadWindowManager ID="ucRadWindowManager" RestrictionZoneID="WindowContainer" OnClientDragEnd="FixFocus" OnClientResize="FixFocus" OnClientCommand="FixFocus" OnClientShow="OnClientShow" PreserveClientState="true" runat="server" Skin="Telerik">  

    any ideas?


  2. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 21 Oct 2009 Link to this post

    Hello Ian,

    With the recent versions of the control, OnClientShow, OnClientClose etc. are called for the dialogs (radprompt, radconfirm, radalert) as well. That is the reason why your code is not working as expected. I suggest to set the OnBeforeClose handler directly to the RadWindow object when you open it, e.g.
    otherwise it will be added to the radconfirm dialog as well.

    Best wishes,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. ian webster
    ian webster avatar
    14 posts
    Member since:
    Jan 2006

    Posted 22 Oct 2009 Link to this post

    Thanks Georgi your suggestion worked.
Back to Top