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

Ajax tooltip with asp:button

1 Answer 110 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Michael Tissington
Top achievements
Rank 1
Michael Tissington asked on 19 Nov 2007, 10:55 PM
I have an asp:button with an OnCommand event.

In the code behind I'd like to Validate the page and return either the tooltip (and show it) or do some other processing.

How do I go about returning the tooltip and showing it ?

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 20 Nov 2007, 12:32 PM
Hello Michael Tissington,
Please have a look at the following code fragment that demonstrates one possible approach:

aspx:
<body> 
    <script type="text/javascript">  
    function OpenToolTip()  
    {  
        Sys.Application.add_load(ShowToolTip);          
    }  
      
    function ShowToolTip()  
    {  
        var tooltip = $find('<%= RadToolTip1.ClientID %>');  
        tooltip.show();  
        Sys.Application.remove_load(ShowToolTip);  
    }  
    </script> 
    <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
        <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="Button1"   
            RelativeTo="Element" ShowEvent="OnRightClick">  
        </telerik:RadToolTip> 
        <asp:Button ID="Button1" runat="server" Text="ShowToolTip" OnClick="Button1_Click" /> 
    </form>      
</body> 

code-behind:
protected void Button1_Click(object sender, EventArgs e)  
{  
    if (Button1.Text == "ShowToolTip")  
    {  
        Page.RegisterStartupScript("openToolTip""<script>OpenToolTip();</script>");  
        Button1.Text = "Second";  
    }  


All the best,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ToolTip
Asked by
Michael Tissington
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or