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

Two Panels that Update Each Other Causing Full Refresh

5 Answers 175 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Levi
Top achievements
Rank 1
Levi asked on 12 Aug 2008, 04:31 AM
I have two panels that update each other via the RadAjaxManager and RadAjaxManagerProxy. When doing an update one way, it works fine. When both panels update each other, a page reload occurs each time I click on a option button from one of the panels (instead of the expected Ajax behavior).

Here are my project details:
I have a main page (default.aspx) that has an RadAjaxScriptManager. The same page has an ascx control that gets loaded by default and is used to filter dates:

            <telerik:RadPane ID="subnavPane" runat="server" Width="200">
                <asp:Panel ID="panelFilter" runat="server">
                    <uc2:DateFilters ID="DateFilters1" runat="server" />
                </asp:Panel>
            </telerik:RadPane>

The DateFilters ascx control has option buttons that update another panel located on the main page. I set this up via the RadAjaxManagerProxy

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rbtnToday">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panelContent" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

The updated panel is (PanelContent) and is located on the main page:

            <telerik:RadPane ID="contentPane" runat="server" Width="756" Scrolling="None">
                <asp:Panel ID="panelContent" runat="server">
                </asp:Panel>
                <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" Height="75px" Width="75px" runat="server"
                    Transparency="0">
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Loading.gif" Style="margin-left: 0px;
                        margin-top: 140px;" BorderWidth="0px" AlternateText="Loading"></asp:Image>
                </telerik:RadAjaxLoadingPanel>
            </telerik:RadPane>

This by itself works fine and as expected. When the option button gets clicked from the DateFilter, my function gets called which dynamically loads a new ascx control into the panel i setup on the main page (panelContent). This was done just like the example on your site for dynamically loading ascx controls and by itself works great.

On the dynamically loaded control, i added a new button which in turn needs to update the date filter panel. I set this up like this;
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxyLocal" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="LinkButton1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panelFilter" />
                </UpdatedControls>              
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

This seems to work ok when clicking on the new button I added, although now the option button from the date filter causes the whole page to reload each time I click on it.

Also, it seems to be enabling ajax updating on all the controls in the dynamically loaded ascx control, which doesn't make any sense to me since there is no ajax proxy creating these associations. All the examples I saw had functions like AjaxifySelf, which doesn't seem valid because it's already doing this automatically against my wishes. All the controls on the dynamically loaded user control are updating each other without page refreshes, which seems like a bug, but maybe I am missing somethning. Can i keep it from doing this? I'd rather create the associations manually to improve performance and get the finite control I need.

Can you tell me what I am doing wrong in these cases? Any help would be greatly appreciated.

Thanks,
Levi

5 Answers, 1 is accepted

Sort by
0
plamen
Top achievements
Rank 1
answered on 15 Aug 2008, 10:35 AM
hi



Actually, the child controls of nested Panel controls will cause an update of the parent Panel control's.


Regards...
<John:Peel />

0
Levi
Top achievements
Rank 1
answered on 15 Aug 2008, 01:10 PM
It does not seem like you guys put a lot of effort into your replies or reading the problems at hand. It's not a parent panel I am trying to update. It's another user control that happens to be on the same page as the dynamically loaded user control.

The other issue is that all the controls on the dynamically loaded control are all updating each other, which is a performance issue and makes the whole concept of the ajax managner useless.
0
plamen
Top achievements
Rank 1
answered on 18 Aug 2008, 08:29 AM
hi


By default the AJAX Manager ajaxifies all controls placed inside AjaxSettings collection and updates all controls inside UpdateControls collection. If you want to exclude a control from ajaxifying you can use one of the following approaches: Exclude controls from ajaxifying

Hope this helps...
<John:Peel />





0
Levi
Top achievements
Rank 1
answered on 18 Aug 2008, 01:39 PM
Thanks for your reply. While this is somewhat helpful in finding a solution, I'm not using an Ajax Panel and don't see any reason why the controls I'm loading should be ajaxified. All the examples i saw on your site showed the ajaxproxy being used inside the dynamically loaded control to ajax individual elements. Just because i'm loading a user control dynamically, why should the controls all be ajaxified? This seems like a bug to me. I mentioned this in a previous support request and even the person helping me said that there was a way to load a dynamic user control without the controls inside of it becoming ajaxified, yet I have not received a working solution on how to do this. This seems like a very common task and I'm surprised that there are no examples on this. The example in your online demos does not address ajaxifying various elements of the loaded user control. Any real application would need to do this. Even in your tutorial videos, you say its a major performance problem to not use the ajaxmanager to set specifically which controls should update each other, yet just because I need to load a user control into a "regular" panel, I'm forced to go through and disabled ajax updating on every control inside of it. Like I said, this seems contradictory to the whole concept of the ajaxproxy, which is what I should be using to setup these relationships. I doubt I stand alone on this. It should be very easy to do the following:

1) Load a user control into a regular panel without a post back.
2) Have a way to setup individual ajax relationships between the elements in the loaded user control. So far this does not seems possible when not doing a post back to load the user control.

Thanks again for your time and sorry for the lengthy response.

Levi

0
Maria Ilieva
Telerik team
answered on 18 Aug 2008, 02:40 PM
Hello Levi,

I have already answered to your support ticket regarding the same problem. Please review the provided answer and let us know if further questions arise.

Greetings,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Levi
Top achievements
Rank 1
Answers by
plamen
Top achievements
Rank 1
Levi
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or