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

Updating user controls independently using RadAjaxManager

8 Answers 260 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jimmy Nicolacopoulos
Top achievements
Rank 1
Jimmy Nicolacopoulos asked on 18 Feb 2010, 04:10 PM
Hi,

I have an aspx page that contains 4 user controls. The apsx page contains a RadAjaxManager control and each user control (.ascx) has a RadAjaxManagerProxy. Currently, I ajaxify all 4 user controls simultaneously through ajaxRequest call in the aspx page as follows:

Base.aspx :

<script type="text/javascript"
         function pageLoad(sender, eventArgs) { 
             if (!eventArgs.get_isPartialLoad()) { 
                 $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest('WidgetLoad'); 
             } 
         }       
</script>   


The argument 'WidgetLoad' gets parsed inside the ajaxRequest handler that's defined in each user control (ascx.cs). This works perfectly however some user controls take longer to update than others and thus block the updating process for the other more quicker user controls. Therefore, I would like to have each user control update independently, as soon as its ready. To do this, I tried calling 4 separate ajaxRequest methods instead of one, passing a unique ID for the user control as an argument each time. However, this does not seem to work. It seems as though it only accepts the last ajaxRequest call thus causing only one user control to update. Can you explain why we cannot call multiple ajaxRequest with same RadAjaxManager? How else can I achieve this behavior?

Jim

8 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 18 Feb 2010, 04:28 PM
Hello Jimmy,

You may consider initiating ajax request using the ajaxRequest(args) client method of the manager to perform additional ajax request and load the widgets inside the OnAjaxRequest server handler. For this purpose you need to set the ajax manager as an initiator and the widgets as updated controls through RadAjaxManager setting.

I hope this gets you started properly.

All the best,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jimmy Nicolacopoulos
Top achievements
Rank 1
answered on 18 Feb 2010, 04:50 PM
Hello Pavlina,

This is what I am doing right now (except I have RadManagerProxy control in each user control that sets the widget as an updated control and AjaxControlID="RadAjaxManagerProxy1"). This mechanism updates all user controls simultaneously (all user controls are shown as loading). However,  I need to be able to update each widget independently (i.e. widget1 and widget2 are loading while widget3 and widget4 are already loaded). Can I do several ajaxRequest with the same RadAjaxManager?

Jim
0
Pavlina
Telerik team
answered on 19 Feb 2010, 01:54 PM
Hello Jimmy,

Could you please try to use the ajaxRequestWithTarget(eventTarget, eventArgument) function instead of ajaxRequest and see if it works as expected.

For more information, please refer to these articles:
http://www.telerik.com/help/aspnet-ajax/ajxclientsideapi.html
http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/clientsideapi/defaultcs.aspx

All the best,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jimmy Nicolacopoulos
Top achievements
Rank 1
answered on 22 Feb 2010, 03:38 PM
If I use ajaxRequestWithTarget method and i pass an argument, I would need to override the RaisePostBackEvent in order to access it on the server side. However, I cannot override this method inside of a user control since its only available on the page. Any other ideas? How can I access an argument passed with ajaxRequestWithTarget() inside a user control?
0
Pavlina
Telerik team
answered on 25 Feb 2010, 08:58 AM
Hello Jimmy,

In this case, would it be convenient for you to open a formal support ticket in order to send me a simple runnable project. I could then have a better look on your scenario and setup and advise you further.
Thank you for your cooperation in advance.

Kind regards,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jimmy Nicolacopoulos
Top achievements
Rank 1
answered on 02 Mar 2010, 03:19 PM
I'm not sure if I can provide a runnable project since it would require including a database connection and that is not possible. However, I only need to know if it's possible send multiple concurrent ajax requests using RadAjax and if so, how. In standard ajax, you can easily achieve this by having multiple XMLHttpRequest objects in a single page. But with RadAjax, you're are not allowed to have more than one RadAjaxManager per page and thus I'm not sure if it supports multiple concurrent ajax calls. If this is the case then I must pursue other avenues in finding a solution to my problem.

Thanks,

Jim
0
robertw102
Top achievements
Rank 1
answered on 03 Mar 2010, 03:25 PM
Why not set the RequestQueueSize of the RadAjaxManager to 4. That way, you can make four separate ajax calls, which will not block each other. Although each request is put in a queue and the requests in the queue are called after the one before it is finished processing, but it's the best solution I can think of.

I hope that helps.
0
Jimmy Nicolacopoulos
Top achievements
Rank 1
answered on 04 Mar 2010, 08:01 PM
This worked! Thank you.
Tags
Ajax
Asked by
Jimmy Nicolacopoulos
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Jimmy Nicolacopoulos
Top achievements
Rank 1
robertw102
Top achievements
Rank 1
Share this question
or