Updating user controls independently using RadAjaxManager

9 posts, 0 answers
  1. Jimmy Nicolacopoulos
    Jimmy Nicolacopoulos avatar
    5 posts
    Member since:
    Feb 2010

    Posted 18 Feb 2010 Link to this post

    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
  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 18 Feb 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jimmy Nicolacopoulos
    Jimmy Nicolacopoulos avatar
    5 posts
    Member since:
    Feb 2010

    Posted 18 Feb 2010 Link to this post

    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
  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 19 Feb 2010 Link to this post

    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.
  6. Jimmy Nicolacopoulos
    Jimmy Nicolacopoulos avatar
    5 posts
    Member since:
    Feb 2010

    Posted 22 Feb 2010 Link to this post

    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?
  7. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 25 Feb 2010 Link to this post

    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.
  8. Jimmy Nicolacopoulos
    Jimmy Nicolacopoulos avatar
    5 posts
    Member since:
    Feb 2010

    Posted 02 Mar 2010 Link to this post

    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
  9. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 03 Mar 2010 Link to this post

    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.
  10. Jimmy Nicolacopoulos
    Jimmy Nicolacopoulos avatar
    5 posts
    Member since:
    Feb 2010

    Posted 04 Mar 2010 Link to this post

    This worked! Thank you.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017