Changing from multiple AJAX managers to one

4 posts, 0 answers
  1. StephenWRogers
    StephenWRogers avatar
    31 posts
    Member since:
    Dec 2006

    Posted 14 May 2008 Link to this post


    I'm looking at changing our project from using the old Telerik AJAX framework to the new one.  The biggest problem that I can see we are going to have is with the RadAjax changes.

    Currently we have one AjaxManager on the master page, but also potentially other AjaxManagers contained within various web controls. These web controls are usually CompositeControls, which need to perform asynchronous postbacks and update other controls within them.

    With the old version of Telerik ajax, this has been achieved by creating an AjaxManager within the composite control and hooking up to the AjaxRequest event where the relevant code can be run.  AjaxSettings can also be added to the manager to update the necessary controls.  All the functionality is then encapsulated within the composite control itself.

    As far as I can see, with the new framework it is recommended, or indeed required, that I have one AjaxManager per page, and all the AjaxSettings and code within my AjaxRequest event handler will have to be moved to that AjaxManager.

    The problem I can see having with this is that where the old AjaxRequest on the web control would automatically only run the relevant code and update the relevant controls it will now fire all the event handlers hooked up to AjaxRequest of the master manager and update all the controls set within all the AjaxSettings.

    Obviously I could perhaps make use of the event argument to only run certain bits of code when the request is fired from different places - although I'm not sure how to handle only updating certain controls - but I seem to have lost the ability to encapsulate the ajax functionality within my composite controls.

    Is there an easier way?  Am I missing something?

  2. Sebastian
    Sebastian avatar
    9934 posts

    Posted 17 May 2008 Link to this post

    Hello StephenWRogers,

    Indeed with RadAjaxManager for ASP.NET AJAX you can only have a single manager on a page/master page to ajaxify all controls within the same page/content pages. However, if you define the ajax settings programmatically within the composite control to refresh only certain controls when a specific action is triggered, only the marked controls will be updated when the ajax request is executed.  Hence you can still define granular ajax settings inside your composite controls.

    Further information about how to perform ajax updates inside composite controls you can gather from this resource.

    Best regards,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. gordon
    gordon avatar
    1 posts
    Member since:
    May 2008

    Posted 19 May 2008 Link to this post

    i have a similar problem.  i have a page with a series of user controls.  i dynamically load a subset of the controls.  most of the user controls has a radgrid, which i edit and rebind via a radwindow.  i was able to figure out how to handle the server-side rebinding, but i'm not sure how to have only the control i edit update.  when should i programatically add/remove the user control from the settings to make this work?  thanks.
  4. Kiara
    Kiara avatar
    309 posts
    Member since:
    Jul 2006

    Posted 21 May 2008 Link to this post

    I do not know what exactly you want to achieve, but recently found this help articles which can be useful to you:

    Loading user controls with ajax

    Add AjaxSettings dynamically


Back to Top