Page Element might need to be updated on each AJAX Request

6 posts, 1 answers
  1. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 13 May 2011 Link to this post

    Suppose you have a dialog with several buttons and other controls that initiate an AJAX request. There is one element in the dialog that might need to be updated by any AJAX request, Do I have to specify this element as the target for each initiator? Or is there some way for saying "whatever AJAX request is done, this element needs to be updated in any case"?

    In this case the element in question is some area containing an error message. Most of the time it is hidden, but if any exception is thrown on some AJAX request, the code must make the element visible and fill it with the error message.

    Michael G. Schneider
  2. Answer
    Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 13 May 2011 Link to this post

    Hello mgs,

    Any control that is updated as a result of an ajax request needs to be added to the UpdatedControls collection of any AjaxSetting or it will not get updated when the ajax request occurs. So yes, you need to set that control to as a target for each initiator.

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 13 May 2011 Link to this post

    Hello Cori,

    thanks a lot for the answer. I do not know whether this would be a suggestion for Telerik or for Microsoft: I appreciated if an element could be marked as "always update, no matter which initiator".

    Michael G. Schneider
  5. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 14 May 2011 Link to this post

    Suppose there are several controls that should be updated with an AJAX request. If these are wrapped by some "div" as in...

    <div id="wrapper" runat="server">
       <telerik:RadTextBox ID="lastname" runat="server" />
       <telerik:RadTextBox ID="firstname" runat="server" />
       <telerik:RadTextBox ID="city" runat="server" />
    </div>

    ...will it be sufficient to specify the wrapper as the target for the AJAX request?

    I tried, and I think that setting "telerik:AjaxUpdatedControl" descends down the control tree. However, I did not find it being mentioned in the documentation.

    Michael G. Schneider
  6. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 18 May 2011 Link to this post

    Hello,

    Possible approach in this case is to wrap the control that needs to be always updated ion a regular asp Panel. The asp Panel is kind of a control which if once added to the RadAjax settings will be updated on each Ajax Request no matter of the initiator.


    All the best,
    Maria Ilieva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  7. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 18 May 2011 Link to this post

    Thanks a lot for this suggestion. I will try it.

    Michael G. Schneider
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017