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

DestroyOnClose being ignored in Q3 release

1 Answer 107 Views
Window
This is a migrated thread and some comments may be shown as answers.
KDL
Top achievements
Rank 1
KDL asked on 07 Nov 2009, 12:54 AM
The DestroyOnClose property seems to be ignored (treated as always FALSE) with the latest Q3 release (downloaded this morning).

Pages that worked fine prior to upgrading to Q3, now load and display every RadWindow that the page has ever displayed, on postback. So if I click a button to display a window then close it and click the button again, it will display 2 copies of the window. If I close it and click the button again, it will display 3 copies of the window (and so on). This behavior occurs with RadGrid popup windows as well.

      
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="btnCreateAccount">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="lnkPasswordRecovery">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="lnkPrivacy">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="lnkSecurity">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
      
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" 
        DestroyOnClose="true" 
        Behaviors="Close,Move"   
        Modal="false" 
        KeepInScreenBounds="true" 
        VisibleStatusbar="false"    
        VisibleOnPageLoad="true" 
        Animation="None"        
        > 
    </telerik:RadWindowManager> 
     

As various buttons are clicked, I add RadWindows to the RadWindowManager in the codebehind (typically just setting NavigateUrl, Height, and Width).

        Dim rw As New RadWindow  
        With rw  
            .NavigateUrl = NavigateUrl  
            .Height = Height  
            .Width = Width  
        End With 
 
        ' Add it to the RadWindowManager's Windows collection  
        rwManager.Windows.Add(rw)  

So if I click a button that loads a RadWindow, close the Window, then click the button again it will display BOTH the first window and the second. Even the overlay gets loaded multiple times.

Like I mentioned, this works perfectly with Q2, the behavior is consistent on all my pages that use the RadWindow. Please advise, thanks!

1 Answer, 1 is accepted

Sort by
0
KDL
Top achievements
Rank 1
answered on 07 Nov 2009, 05:17 AM

So I stumbled onto this (Changes and Backward Compatibility) which addresses the problem:

Telerik RadWindow for ASP.NET AJAX Q3 2009

  • When a RadWindow is declared in  RadWindowManager it preserves its ViewState which was not so in previous versions. This could lead to backwards incompatibility when the VisibleOnPageLoad property is used in this configuration with the idea to show the RadWindow only once. Possible solutions for this case are the following ones:
    • Set EnableViewState = "false" for the RadWindowManager
    • Reset the VisibleOnPageLoad property to false with code when suitable, depending on the particular scenario
    • Show the RadWindow through registering a script from the server instead.

Setting EnableViewState="false" solved my problem in this case. Hope this saves someone some grief! :)

Tags
Window
Asked by
KDL
Top achievements
Rank 1
Answers by
KDL
Top achievements
Rank 1
Share this question
or