RadAjaxManager full postback on second button click

3 posts, 1 answers
  1. Danny
    Danny avatar
    29 posts
    Member since:
    Feb 2012

    Posted 13 Mar 2012 Link to this post

    Hi,

    I'm having a problem with the RadAjaxManager. When I click the button for the first time, it works correclty (doing a partial postback). On the second click, a full postback is done. I found some similar posts on this issue, but none of them helped me solved the problem.

    The button is inside a RadToolTip. The following code should reproduce the problem.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="BC_Cockpit.Website.test.WebForm1" %>
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
     
    <!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>
      <script>
        alert('page load');
      </script>
    </head>
    <body>
      <form id="form1" runat="server">
      <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
          <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnSaveGeneral">
              <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="tipGeneralSettings" />
              </UpdatedControls>
            </telerik:AjaxSetting>
          </AjaxSettings>
        </telerik:RadAjaxManager>
        <img id="imgGeneralSettings" src="/main/images/icons/cog.png" alt="Settings" />
        <telerik:RadToolTip ID="tipGeneralSettings" IgnoreAltAttribute="true" runat="server" ShowDelay="0" IsClientID="true" ManualClose="true" TargetControlID="imgGeneralSettings"
          RenderInPageRoot="true" RelativeTo="Element" Position="BottomLeft" Width="250" ShowEvent="OnClick" Title="General settings" CssClass="bright-form-popup">
          Settings here..
          <asp:Button Text="Save" ID="btnSaveGeneral" runat="server" OnClick="btnSaveGeneral_Click" />
        </telerik:RadToolTip>
      </div>
      </form>
    </body>
    </html>

    Watch for the 'page load'  alert on the 2nd click.

    I'm a doing anything wrong? Or is this some kind of bug?

    Thanks
  2. Answer
    Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 16 Mar 2012 Link to this post

    Hi Danny,

    Note that it is actually incorrect approach to add the inner for the tooltip control (button in your case) to update its container (the RadToolTip itself). In your case if you need to perform ajax on the button click I  would suggest you to internally wrap the button in RadAjaxPanel instead of using RadAjaxManager, like this:
    <telerik:RadToolTip ID="tipGeneralSettings" IgnoreAltAttribute="true" runat="server"
           ShowDelay="0" IsClientID="true" ManualClose="true" TargetControlID="imgGeneralSettings"
           RenderInPageRoot="true" RelativeTo="Element" Position="BottomLeft" Width="250"
           ShowEvent="OnClick" Title="General settings">
           Settings here..
           <telerik:RadAjaxPanel ID="RAP1" runat="server">
               <asp:Button Text="Save" ID="btnSaveGeneral" runat="server" />
           </telerik:RadAjaxPanel>
       </telerik:RadToolTip>
     
    Give this a try and let me know if it helps.

    Greetings,
    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. Danny
    Danny avatar
    29 posts
    Member since:
    Feb 2012

    Posted 16 Mar 2012 Link to this post

    Yes it works!
    Thanks :)
Back to Top