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

ToolTip Opera/Firefox problem for OnClick-Event

4 Answers 85 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 1
Marco asked on 12 Nov 2007, 10:54 AM
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

4 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 13 Nov 2007, 02:25 PM
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
0
Marco
Top achievements
Rank 1
answered on 13 Nov 2007, 07:13 PM
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
0
George
Telerik team
answered on 15 Nov 2007, 03:10 PM
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
0
Marco
Top achievements
Rank 1
answered on 16 Nov 2007, 08:31 AM
Hallo!

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

I always like the support of Telerik ;-)

Regards,
Marco
Tags
ToolTip
Asked by
Marco
Top achievements
Rank 1
Answers by
George
Telerik team
Marco
Top achievements
Rank 1
Share this question
or