ToolTip Opera/Firefox problem for OnClick-Event

5 posts, 0 answers
  1. Marco
    Marco avatar
    12 posts
    Member since:
    Nov 2007

    Posted 12 Nov 2007 Link to this post

    Dear Community!

    I have the following problem:

    I created a simple test with a button and a tooltip-control on the site. When I click the button, the tooltip has to be shown. Therefore, I use the ShowEvent-property and set this to "OnClick".

    In InternetExplorer, this works fine, but in Opera and Firefox, the tooltip is not shown. When I use the same technique, but replace the button control with a linkbutton-control, it also works for Opera and Firefox.

    I think, the issue can be the runat-tag (I can'T leave this out for a button, because else, it is not rendered on the final page).

    Please have a look at the following code-block (the code-behind-file has no special code).

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
     
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
    <%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" Assembly="Telerik.QuickStart" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head runat="server">  
        <title>Untitled Page</title> 
    </head> 
    <body> 
       <form id="form1" runat="server">  
          
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
          
        <telerik:RadToolTip ID="RadToolTip" runat="server" Width = "300px" 
        Height = "100px" 
        Animation = "Resize" 
        Position="BottomRight"        
        ManualClose="True" 
        ShowEvent="OnClick" 
        IsClientID="true" 
        TargetControlID="Button1" 
        Skin="Inox"   
        /> 
     
        <div> 
            <br /> 
            <asp:LinkButton ID="LinkButton1" >Details</asp:LinkButton> 
            <br /><br /> 
            <asp:Button ID="Button1" runat="server" Text="Button" /> 
        </div> 
           
        </form> 
    </body> 
    </html> 

    Help would really be appreciated.

    Best regards,
    M. Beyer
  2. George
    Admin
    George avatar
    859 posts

    Posted 13 Nov 2007 Link to this post

    Hi Marco,

    Thank you for the detailed information.

    Your issue is connected with the default button appearance under Firefox.
    The problem is due to the fact that when you press the Asp:Button you are automatically making a PostBack. To be able to launch the ToolTip before the PostBack, you must set the OnClientClick event to return false:

    OnClientClick="return false;"

    I hope this information helps.

    All the best,
    George
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Marco
    Marco avatar
    12 posts
    Member since:
    Nov 2007

    Posted 13 Nov 2007 Link to this post

    Hallo!

    Thanks for replying! Indeed, this was new to me and now I understand, why the control behaves like that. Have many thanks.

    In my case, it was quite a bite unfortunate, because I used the button in order to check, if the user was logged in and if so, the tooltip (with further information) should be shown.

    Now I perform the check inside a user control. The user control is loaded into the tooltip and the user now can just press a button (on the tooltip) if he is logged in. Not perfect, but a solution.

    By the way: There is no solution for the firefox/opera that I can press the asp button, perform the check and if the check is successful, show the tooltip? I believe no, because after pressing the button, I fire a postback and therefore the tooltip won't be shown. Is that correct?

    Regards and I really appreciate the support of telerik!

    Marco
  4. George
    Admin
    George avatar
    859 posts

    Posted 15 Nov 2007 Link to this post

    Hi Marco,

    Yes, you can achieve the requested functionality.

    I have made and attached a simple project demonstrating how the desired functionality can be achieved. It is important to note that the RadToolTip's RelativeTo property value have to be set to Element in order to ensure that the tooltip is relative to the button (as in your case). Your checks can be done via the CodeBehind.

    I hope the information helps.

    Kind Regards,
    George
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Marco
    Marco avatar
    12 posts
    Member since:
    Nov 2007

    Posted 16 Nov 2007 Link to this post

    Hallo!

    Many thanks for the tip. That was helpful for me!

    I always like the support of Telerik ;-)

    Regards,
    Marco
Back to Top