This is a migrated thread and some comments may be shown as answers.
OnBubbleEvent not firing within AjaxUpdatePanel
9 Answers 50 Views
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 21 Jun 2012, 08:22 PM
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?

9 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 26 Jun 2012, 11:47 AM
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.
0
David
Top achievements
Rank 1
answered on 26 Jun 2012, 12:12 PM
That will work for now - thank you.
0
David
Top achievements
Rank 1
answered on 26 Jul 2012, 06:11 PM
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?
0
David
Top achievements
Rank 1
answered on 26 Jul 2012, 06:32 PM
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;
  }

0
Maria Ilieva
Telerik team
answered on 01 Aug 2012, 07:52 AM
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.
0
Doug
Top achievements
Rank 1
answered on 22 Apr 2014, 10:59 AM
Did this ever get fixed?
0
Maria Ilieva
Telerik team
answered on 25 Apr 2014, 10:27 AM
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.

 
0
Doug
Top achievements
Rank 1
answered on 25 Apr 2014, 10:29 AM
RaiseBubbleEvent doesn't cause controls above a RadAjaxPanel to receive the handlebubble event...
0
Maria Ilieva
Telerik team
answered on 30 Apr 2014, 10:44 AM
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.

 
Tags
Ajax
Asked by
David
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
David
Top achievements
Rank 1
Doug
Top achievements
Rank 1
Share this question
or