This is a migrated thread and some comments may be shown as answers.

RadAjaxManager full postback on second button click

2 Answers 231 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Danny
Top achievements
Rank 1
Danny asked on 13 Mar 2012, 11:01 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Maria Ilieva
Telerik team
answered on 16 Mar 2012, 08:10 AM
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.
0
Danny
Top achievements
Rank 1
answered on 16 Mar 2012, 09:32 AM
Yes it works!
Thanks :)
Tags
Ajax
Asked by
Danny
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Danny
Top achievements
Rank 1
Share this question
or