Decouple initiator and updated controls from the RadAjaxManager by using ASP.NET event bubbling

Thread is closed for posting
5 posts, 0 answers
  1. A9E74E7C-52FA-4440-8D67-C26A0770B01B
    A9E74E7C-52FA-4440-8D67-C26A0770B01B avatar
    16 posts
    Member since:
    May 2004

    Posted 17 Aug 2006 Link to this post

    Requirements

    r.a.d.controls version

    Q2 2006 SP1 or later

    .NET version

    2.0, but it can be reworked for 1.x too

    Visual Studio version

    VS2005

    programming language

    C#

    browser support

    all browsers supported by r.a.d.controls


     
    PROJECT DESCRIPTION 

    Some business cases require building a loosely coupled web site that has to be able to trigger AJAX requests from one area and update that area and/or various other areas depending on some conditions.  You can achieve that with only one RadAjaxManager on your page that will have its AjaxSettings configured dynamically.  There are three tricky moments in such cases:
    • describing which control will update which other controls
    • finding the initiator and updated controls and adding ajax settings for them
    • finding a control to update inside a user control since user controls are not updateable

    The examle here loads two user controls.  Both implement a simple interface that can be used to get a control that will be updated with Ajax -- an inner <asp:Panel> in our case.  That solves the third problem.  The second problem can be solved by bubbling events from the control and handling them on the page.  We use two event names: RegisterUpdatableControl that will add an AjaxSetting used to update the control itself; AreaUpdate -- just a name that is used to distinguish when to add AjaxSettings for the other area controls.  This can be used to implement the rules mentioned above -- you can use the initiator control and command name to define different AjaxSettings that suit your needs.

    Here is the list of the most interesting parts of the code:

    • The IUpdatableControl interface and its implementation in the user control that returns the inner panel.
    • The RaiseBubbleCommand call in the user control Page_Load event that registers the control for Ajax.
    • The RaiseBubbleCommand in the Button2_Click event handler that will request updating both controls.  Normally, only one of the controls will be updated.
    • The OnBubbleEvent page method override that adds the AjaxSettings according to the initiator control and event name.

  2. 9B5A7639-A750-4019-BD45-5FB907669ABB
    9B5A7639-A750-4019-BD45-5FB907669ABB avatar
    26 posts
    Member since:
    May 2006

    Posted 23 Aug 2006 Link to this post

    Hi, the zip seems to be empty,i would really like to see the code
  3. 14DD1020-39B2-4B9F-B23C-5E3E5E5BBD6F
    14DD1020-39B2-4B9F-B23C-5E3E5E5BBD6F avatar
    170 posts
    Member since:
    May 2013

    Posted 24 Aug 2006 Link to this post

    Hello Shane,

    There was a glitch in our live server that is already fixed. Now you should be able to download the file correctly.

    Please excuse us for the inconvenience we might have caused you.

    Best wishes,
    Natalie Farah
    the telerik team
  4. 3F28E8EC-BAA9-47EE-A208-340CD8C27C9A
    3F28E8EC-BAA9-47EE-A208-340CD8C27C9A avatar
    68 posts
    Member since:
    Feb 2005

    Posted 05 Apr 2007 Link to this post

    Is there anyway to get this in VB.net 1.1?


    j
  5. 97D3B669-4395-4648-9DCE-4CF1D54E5353
    97D3B669-4395-4648-9DCE-4CF1D54E5353 avatar
    32 posts
    Member since:
    Jul 2007

    Posted 23 Jul 2007 Link to this post

    this is just works fine in normal page and usercontrol.what about the ajax manager in master page and want to loosely coupled update control in content page.Since the master page is not the parent page of the content page,the OnBubbleEvent is not invoked,so this doesnt work.
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.