asp:Button postback always closes RadTooltip

2 posts, 0 answers
  1. ksuh
    ksuh avatar
    44 posts
    Member since:
    Jul 2006

    Posted 21 Sep 2011 Link to this post

    Even if I cancel the close event, the tooltip always closes on postback.  Async postback does the same thing.  Other regular buttons (e.g. html button) work as expected - the close event gets cancelled.

    The button is inside the the RadTooltip.

    Any ideas?
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 23 Sep 2011 Link to this post

    Hi  Kwang,

    When a postback occurs the entire page is disposed and therefore the RadToolTip should hide, as it is a control that "lives" in the page. In the case of an AJAX request you need to make sure that the RadToolTip is not disposed again - i.e. it is outside of the update panel. The so-called HTML buttons (I assume you mean <button> and <input type="button" /> ) do not perform a postback and therefore do not dispose the page. This means that for a button within the tooltip you need to place the update panel within the tooltip as well, for example:

    <asp:Button ID="Button1" Text="postback and the tooltip SHOULD hide" runat="server" />
    <div id="target" style="width: 100px; height: 100px; background-color: Yellow;">
        click for tooltip</div>
    <telerik:RadToolTip runat="server" ID="RadToolTip1" TargetControlID="target" IsClientID="true"
        Width="350px" Height="100px" Title="Some Title" ShowEvent="OnClick" HideEvent="ManualClose"
        Position="BottomRight" RelativeTo="Element">
        <asp:UpdatePanel ID="Updatepanel3" runat="server" RenderMode="inline">
            <ContentTemplate>
                This is in an update panel. The tooltip is not inside, so it will not be disposed, and will
                not hide. The trick is that only the content of the tooltip will be updated in the response
                <br />
                <asp:Button ID="Button4" Text="AJAX request and the tooltip will not hide" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </telerik:RadToolTip>



    Best wishes,
    Marin
    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
Back to Top