OnBubbleEvent not firing within AjaxUpdatePanel

10 posts, 0 answers
  1. David
    David avatar
    10 posts
    Member since:
    Nov 2010

    Posted 21 Jun 2012 Link to this post

    I have the following User Control:
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="test.ascx.cs" Inherits="_Controls_test" %>
    <asp:Button ID="btnText" runat="server" Text="test" OnClick="btnTest_Click" />
    protected void btnTest_Click(object sender, EventArgs e)
      {
        CommandEventArgs args = new CommandEventArgs("TestEvent", "bubbled up!");
        RaiseBubbleEvent(null, args);
      }

    Then a parent page:
    <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadAjaxPanel ID="UpdatePanel1" runat="server" LoadingPanelID="UpdateProgress1">
          This is a test page:<br />
          <asp:Literal ID="litTest" runat="server" />
          <br /><br /><br />
          <uc1:testUC ID="testUC1" runat="server" />
        </telerik:RadAjaxPanel>
        <telerik:RadAjaxLoadingPanel ID="UpdateProgress1" runat="server" />
    protected override bool OnBubbleEvent(object source, EventArgs args)
      {
        if (args != null)
        {
          CommandEventArgs e = (CommandEventArgs)args;
          if (e.CommandArgument != null)
          {
            litTest.Text += e.CommandName + " = " + e.CommandArgument.ToString() + "<br />";
            return true;
          }
        }
     
        return false;
      }

    When the button is clicked, the OnBubbleEvent is not fired - if I replace the RadAjaxPanel with an UpdatePanel, it fires (twice, strangely?). If I remove the UpdaetPanel and have it post back, it also fires twice. WHat do I need to do to get this working in RadAjaxPanel?
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 26 Jun 2012 Link to this post

    Hello David,

    I tested the presented scenario and was able to replicate the issue you are facing. It seems that this problematic behaviour is a bug in RadAjaxPanel control. I already forwarded it to our dev team so they will further research on the problem and develop,a fix as soon as possible.
    For now I would suggest you use RadAjaxManager control instead of RadAjaxPanel, like this:

    <telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="UpdateProgress1"
        runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Panel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <asp:Panel ID="Panel1" runat="server">
        This is a test page:<br />
        <asp:Literal ID="litTest" runat="server" />
        <br />
        <br />
        <br />
        <uc1:testUC ID="testUC1" runat="server" />
    </asp:Panel>
    <telerik:RadAjaxLoadingPanel ID="UpdateProgress1" Skin="Default" runat="server" />

    Thank you for reporting this issue.

    Kind regards,
    Maria Ilieva
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David avatar
    10 posts
    Member since:
    Nov 2010

    Posted 26 Jun 2012 Link to this post

    That will work for now - thank you.
  5. David
    David avatar
    10 posts
    Member since:
    Nov 2010

    Posted 26 Jul 2012 Link to this post

    Unfortunately this workaround is preventing the RadToolTip from working. I have a User Control within the ASP Panel I ajaxified with the RadAjaxManager, and the RadTooltip now fails to fire. Works as expected when taken out of the panel :( How can this be fixed?
  6. David
    David avatar
    10 posts
    Member since:
    Nov 2010

    Posted 26 Jul 2012 Link to this post

    test.ascx:
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="test.ascx.cs" Inherits="_Controls_test" %>
    <telerik:RadToolTipManager runat="server" AnimationDuration="300" ShowDelay="200" HideDelay="1" ID="RadToolTipManager1" Width="480px" Height="227px"
      RelativeTo="Element" Animation="Slide" Position="BottomCenter" OnAjaxUpdate="OnAjaxUpdate" Skin="Telerik" />
    <asp:Button ID="btnText" runat="server" Text="test" OnClick="btnTest_Click" />


    test.ascx.cs:
    protected void Page_Load(object sender, EventArgs e)
      {
        if (!IsPostBack)
        {
          Control btnDetail = (Control)this.FindControl("btnText");
          this.RadToolTipManager1.TargetControls.Add(btnDetail.ClientID, "0", true);
        }
      }
     
      protected void btnTest_Click(object sender, EventArgs e)
      {
        CommandEventArgs args = new CommandEventArgs("TestEvent", "bubbled up!");
        RaiseBubbleEvent(null, args);
      }
     
      protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
      {
        this.UpdateToolTip(args.Value, args.UpdatePanel);
      }
     
      private void UpdateToolTip(string elementID, UpdatePanel panel)
      {
        Control ctrl = Page.LoadControl("/_Controls/ContactBox.ascx");
        panel.ContentTemplateContainer.Controls.Add(ctrl);
      }


    test.aspx (RadToolTip working; BubbleUp event NOT working):
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
    <%@ Register src="~/_Controls/test.ascx" tagname="testUC" tagprefix="uc1" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head id="Head1" runat="server">
      <title></title>
    </head>
    <body>
      <form id="form1" runat="server">
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadAjaxPanel ID="Panel1" runat="server" LoadingPanelID="UpdateProgress1">
          This is a test page:<br />
          <asp:Literal ID="litTest" runat="server" />
          <br />
          <br />
          <br />
          <uc1:testUC ID="testUC1" runat="server" />
        </telerik:RadAjaxPanel>
        <telerik:RadAjaxLoadingPanel ID="UpdateProgress1" Skin="Default" runat="server" />
      </form>
    </body>
    </html>

    test.aspx (RadToolTip NOT working; BubbleUp event firing twice):
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
    <%@ Register src="~/_Controls/test.ascx" tagname="testUC" tagprefix="uc1" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head id="Head1" runat="server">
      <title></title>
    </head>
    <body>
      <form id="form1" runat="server">
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="UpdateProgress1" runat="server">
          <AjaxSettings>
              <telerik:AjaxSetting AjaxControlID="Panel1">
                  <UpdatedControls>
                      <telerik:AjaxUpdatedControl ControlID="Panel1" />
                  </UpdatedControls>
              </telerik:AjaxSetting>
          </AjaxSettings>
        </telerik:RadAjaxManager>
        <asp:Panel ID="Panel1" runat="server">
          This is a test page:<br />
          <asp:Literal ID="litTest" runat="server" />
          <br />
          <br />
          <br />
          <uc1:testUC ID="testUC1" runat="server" />
        </asp:Panel>
        <telerik:RadAjaxLoadingPanel ID="UpdateProgress1" Skin="Default" runat="server" />
      </form>
    </body>
    </html>



    test.aspx.cs:
    protected override bool OnBubbleEvent(object source, EventArgs args)
      {
        if (args != null)
        {
          CommandEventArgs e = (CommandEventArgs)args;
          if (e.CommandArgument != null)
          {
            litTest.Text += e.CommandName + " = " + e.CommandArgument.ToString() + "<br />";
            return true;
          }
        }
     
        return false;
      }

  7. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 01 Aug 2012 Link to this post

    Hello David,

    We are aware of the presented issue and in most cases we suggest our users to use RadAjaxPanel in order to avoid it. In your specific scenario this could not be implemented due to the Bubble Event issue that appear with the RadAjaxPanel control.
    I'm forwarding this cases to our dev team so they could further research on the problems and do their best to develop a proper fix. As soon as we have any updates on the issue we will get back to you with our findings.


    All the best,
    Maria Ilieva
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. Doug
    Doug avatar
    22 posts
    Member since:
    Apr 2009

    Posted 22 Apr 2014 Link to this post

    Did this ever get fixed?
  9. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 25 Apr 2014 Link to this post

    Hello,

    We made some improvements in the Ajax functionality for the last two years since this issue has been logged. Therefore I would kindly ask you to elaborate what is the exact problem you are currently facing and what is the scenario you need to implement. Thus we could further investigate in your specific case and verify if a fix for it is already available.

    Regards,
    Maria Ilieva
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  10. Doug
    Doug avatar
    22 posts
    Member since:
    Apr 2009

    Posted 25 Apr 2014 in reply to Maria Ilieva Link to this post

    RaiseBubbleEvent doesn't cause controls above a RadAjaxPanel to receive the handlebubble event...
  11. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 30 Apr 2014 Link to this post

    Hello Doug,

    Currently the described issue still appears in the RadAjaxPanel control as modifying this behavior could lead to a Breaking Change. For now you could handle the RadAjaxPanel OnCommand event to achieve similar scenario as the one showed in the beginning g of this thread.
    Our dev team is currently discussing the option to fix this behavior by creating a property and enable it conditionally to avoid breaking change and I will get back to you as soon as any solution is taken.

    Regards,
    Maria Ilieva
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

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