Ajax Panels Updating other child Ajax Panels

6 posts, 0 answers
  1. Adam Moore
    Adam Moore avatar
    4 posts
    Member since:
    Jan 2006

    Posted 28 Apr 2008 Link to this post

    Hi All,

    I'm trying to get one ajax panel to cause another ajax panel to update its content when both ajax panels are children of a user control in two different ajax panels on that control.

    It seems to work fine in the code behind and no errors are displayed. But on the page nothing updates.

    Then if you interact with the ajax panel control that is meant to change and cause a postback it then shows the changes that were meant to be there.

    Is it possible for two child ajax panels to interact with each other?

    cheers
    Adam.
  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 28 Apr 2008 Link to this post

    Adam-

    I apologize for the trouble you're having. I may be a little dense, but I'm having a hard time understanding your configuration based on the original description. Can you elaborate a little more on how your page is constructed? Maybe even provide a diagram? Like:

    UserControl > 2 UpdatePanels > ?

    Frankly, it sounds like you've got a complex enough situation to require RadAjaxManager for better Ajax management. The AjaxManager is specially designed to easily handle complex Ajax interactions, where one part of a page is updating some other part (which it sounds like you're doing). To migrate towards the Manager, simply replace your UpdatePanel with DIVs and then configure your Ajax interactions in the AjaxManager.

    TIP: For controls in an UserControl, you can use the myUserControlId$myControlId syntax when configuring the AjaxManager.

    Hope that helps-
    Todd
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Adam Moore
    Adam Moore avatar
    4 posts
    Member since:
    Jan 2006

    Posted 29 Apr 2008 Link to this post

    Hi Todd, 

    No your probably far from dense … I’m just garbage at explaining myself.

    The image attached explains what I am trying to do…….. hopefully J

    It seems i cant upload the image here so i have put it online.
    http://www.perfectpatients.com/AjaxNavigationDiag.jpg

     ·         The default.aspx page has navigation on it and in this case it is loading in the managesite.acsx control dynamically.

    ·         The managesite.acsx control has sub navigation on it and it is loading into its three panels any combination of the ascx files listed below.

    ·         My problem exists when I get the control in radajaxpanel 3 to update the controls in radajaxpanel 4 and 5. It does it using events which managesite.ascx handles which then launches changes into the other radajaxpanels. From the code behind it all works well with no errors and says it is clearing the panel of all previous controls and dynamically adds  the new control to panel 4 and 5. But when you return back to the page after debugging it doesn’t update the panel contents. However if I click on a sub menu item on managesite.ascx it loads all the panels correctly and shows the changes.

    ·         The funny part about this is. The code I call to load a panel into radajaxpanel 4 and 5 via the event handler for radajaxpanel 3 is exactly the same code the sub menu on managesite.acsx calls. It seems if the call originates from the radajaxpanel 3 then it works fine but doesn’t update the display.

    ·         I have looked at the ajaxmanager for this but I have it working fine to this point. Plus because I am calling in controls dynamically how I am I going to make the ajaxmanager work. One button in radajaxpanel 3 may only update the contents of radajaxpanel 4 while another button in radajaxpanel 3 may update both 4 and 5. 

    Thanks for any light or code examples you can supply to solve this issue. I would send you code as an example but as you could imagine this is a real life project using nettiers that has a ton of code and database connections that are required to work.  

    Cheers

    Adam.

  5. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 29 Apr 2008 Link to this post

    Adam-

    I think the problem you're hitting is precisely due to the use of the RadAjaxPanels (or ASP.NET AJAX UpdatePanels, more generally). In particular, when you use an UpdatePanel to ajaxify a postback event on the page, only controls contained within the panel can be updated after the ajax event complete. To update controls on other portions of the page, you have to start configuring triggers.

    Now triggers can be a messy game, especially when you're dynamically adding UserControls to the page. With the RadAjaxManager, though, there is a more elegant solution.

    On your application's MasterPage, you can add a single RadAjaxManager control. Then on all of your content pages and UserControls, you can add RadAjaxManagerProxy controls to configure the ajax settings for each page element. At runtime, these settings will be rolled-up to the primary AjaxManager and automatically define all necessary UpdatePanels and Triggers on your page to correctly update page elements.

    I know it could require some conversion work now, but in the long run this will make your application much more maintainable. The basic problem with the current architecture is that UpdatePanels (and in turn RadAjaxPanel) are not designed to allow you to update controls outside of the panel on an ajax request. If you absolutely don't want to improve your architecture at this point, there is a way to script the interaction between multiple RadAjaxPanels. See this page in the docs for specific guidance:

    http://www.telerik.com/help/radcontrols/prometheus/
    ?ajxInteractionBetweenPanels.html

    Hope this helps!

    -Todd
  6. Adam Moore
    Adam Moore avatar
    4 posts
    Member since:
    Jan 2006

    Posted 06 May 2008 Link to this post

    Hi Todd,

    The link you provided is what i have based my current design on. i can see what you are saying about AjaxManagers and AjaxManagerProxy, however how would i go about calling an update on one of my parent forms from the child using the AjaxManagerProxies. They basically only let you control what is currently on the page, unless i am missing something here. As my user control pages are called dynamically there is no way for the proxy to say tell the panel on the calling parent to load a different control.

    With the update panels and the methods mentioned in your url provided i can quite easily call these methods on the parent pages using events. It just seems there is a limitation to how many levels you can go before it stops working.

    As can be seen by http://www.perfectpatients.com/AjaxNavigationDiag.jpg
    it works fine until radajaxpanel3 tries to call code on managesite.acsx  to update radajaxpanel4. The code works sweet but the changes just are not reflected to the user.

    While this way is confusing and doing my head in it seems to work to a certain degree. If you could point me forward with the radajaxmanager and how to get it to achieve the same functionality it would be greatly appreciated as it is alot simpler to use compared with what i am doing now.

    Cheers
    Adam.
  7. Rosen
    Admin
    Rosen avatar
    3235 posts

    Posted 07 May 2008 Link to this post

    Hi Adam Moore,

    I have attached a project which demonstrate a similar to described scenario. The idea is that you should not call ResponseScripts for both AjaxPanels at the same time.

    Can you please give it a try and see if it helps? Let us know how it goes.

    All the best,
    Rosen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017