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

RadAjaxPanel have PostBack first time, and UpdatePanel in RadWindow not working.

1 Answer 297 Views
Window
This is a migrated thread and some comments may be shown as answers.
Isaac
Top achievements
Rank 1
Isaac asked on 07 Mar 2011, 01:24 PM
Hello,
My main issue is when I have inside RadWindowManager --> RadWindow --> ContentTemplate an RadAjaxPanel...
When I use it the first time, the page is posting back... I don't want to have the PostBack..
The second time and up, I don't have post back and the LoadingPanel is showing.
I  have had to add a code on the Search Button (inside the ajax panel) to show window on load, since my window is a search box that will search inside content..


I will show you my main template of the page:
The rad Window:
<telerik:RadWindowManager ID="rWinManager" runat="server">
    <Windows>
        <telerik:RadWindow ID="rWinResult" runat="server" OnClientActivate="WindowOnClientActivate" Width="350" Behaviors="Close">
            <ContentTemplate>
                <!--This is the main content that needs to work only with ajax.-->
            </ContentTemplate>
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>


My update panel that works fine outside the RadWindow:
<asp:UpdatePanel ID="MyUpdatePanel" runat="server" UpdateMode="Always">
    <ContentTemplate>
        <!--poting in a table will make the controls aligned.. it was not.-->
        <table>
        <tr>
            <td><telerik:RadTextBox ID="TxtSearch" runat="server" Width="200"></telerik:RadTextBox></td>
            <td>
                <telerik:RadButton ID="BtnSearch" runat="server" OnClick="BtnSearch_Click">
                    <Icon PrimaryIconCssClass="rbSearch" />
                </telerik:RadButton>
            </td>
            <td>
                <asp:UpdateProgress ID="MyUpdateProgress" runat="server" AssociatedUpdatePanelID="MyUpdatePanel">
                    <ProgressTemplate>
                        <span style="color:Gray;font-size:10px;">
                            Loading...
                        </span>
                    </ProgressTemplate>
                </asp:UpdateProgress>
            </td>
        </tr>
        </table>
        <telerik:RadTreeView ID="rtvResult" runat="server" DataFieldID="Key" DataValueField="Key" DataTextField="DisplayValue"></telerik:RadTreeView>
    </ContentTemplate>
</asp:UpdatePanel>

Now when I place the UpdatePanel (the second code snip), inside the Window manager, I am getting error.
Cannot unregister UpdatePanel with ID 'MyUpdatePanel' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.
Parameter name: updatePanel

I hope I was clear with my question... Let me know if you need more code or if you have more questions.

Thank you for your help.
Isaac
Emerald One

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 10 Mar 2011, 03:26 PM
Hello Isaac,

 The issue comes from the fact that in this scenario you have your RadWindow declared in the Windows and Controls collections of a RadWindowManager and inside it the update panel. At some point the manager clears its Controls collection and rebuilds the controls again - however, there is a known problem with the ScriptManager control which holds a reference to the old, already not existing update panel and this causes the issue. The problem can be reproduced in this very same scenario without using RadControls at all but only standard ASP.NET controls.

What I can suggest in order to fix the problem is to put the RadWindow outside the RadWindowManager - there is no limitation of using as many separate RadWindows as you want on the same page and you can keep the manager for predefined dialogs as radalert or for opening other RadWindows.

 For your convenience I modified and attached your demo. I hope that my explanations and the suggested solution helps, let me know how it goes.

All the best,
Svetlina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Window
Asked by
Isaac
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or