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

Changing from multiple AJAX managers to one

3 Answers 123 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
StephenWRogers
Top achievements
Rank 1
StephenWRogers asked on 14 May 2008, 01:17 PM
Hi,

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?

Stephen

3 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 17 May 2008, 08:16 AM
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,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
gordon
Top achievements
Rank 1
answered on 19 May 2008, 03:39 PM
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.
0
Kiara
Top achievements
Rank 1
answered on 21 May 2008, 11:26 AM
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

Kiara

Tags
Ajax
Asked by
StephenWRogers
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
gordon
Top achievements
Rank 1
Kiara
Top achievements
Rank 1
Share this question
or