Handle Tooltip Close event server-side

2 posts, 0 answers
  1. Albert Shenker
    Albert Shenker avatar
    588 posts
    Member since:
    Mar 2004

    Posted 24 Jun 2008 Link to this post

    Is it possible to handle the tooltip close event server-side? Here is my scenario. I use the tootip to display a form. The form contains several pageviews depending on choices the user makes. Swithcing between pageviews is done with Ajax. If the tooltip closes, I wish to select the default pageview so that the next time the tootip is show, the initial pageview is selected (as opposed to whatever pageview they were on when they closed the tooltip).
  2. Kevin Babcock
    Kevin Babcock avatar
    189 posts
    Member since:
    Mar 2007

    Posted 24 Jun 2008 Link to this post

    Hi Albert,

    You can achieve this functionality by using a RadAjaxManager or RadAjaxPanel and initiating an ajaxRequest from the client during the ClientHide event of the RadToolTip. Here is an example:

    1 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
    2 <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    3  
    4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    5  
    6 <html xmlns="http://www.w3.org/1999/xhtml"
    7 <head runat="server"
    8     <title>Untitled Page</title> 
    9 </head> 
    10 <body> 
    11     <form id="form1" runat="server"
    12         <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
    13                  
    14         <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
    15             <script type="text/javascript"
    16                 function RadToolTip1_ClientHide(sender, eventArgs) 
    17                 { 
    18                     var ajaxPanel = $find('<%= RadAjaxPanel1.ClientID %>'); 
    19                     ajaxPanel.ajaxRequest(); 
    20                 } 
    21             </script> 
    22         </telerik:RadCodeBlock>      
    23          
    24         <asp:Image ID="Image1" runat="server" 
    25             ImageUrl="http://tinyurl.com/5ah67f" /> 
    26              
    27         <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"  
    28             OnAjaxRequest="RadAjaxPanel1_AjaxRequest"
    29             <telerik:RadToolTip ID="RadToolTip1" runat="server" 
    30                 TargetControlID="Image1"             
    31                 Skin="Sunset" 
    32                 RelativeTo="Element" 
    33                 Sticky="true" 
    34                 OnClientHide="RadToolTip1_ClientHide"
    35                 Enter some text:  
    36                 <telerik:RadTextBox ID="RadTextBox1" runat="server" /> 
    37             </telerik:RadToolTip> 
    38              
    39             <asp:Literal ID="Literal1" runat="server" /> 
    40         </telerik:RadAjaxPanel> 
    41          
    42     </form> 
    43 </body> 
    44 </html> 
    45  

    1 public partial class _Default : System.Web.UI.Page 
    2
    3     public void RadAjaxPanel1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) 
    4     { 
    5         string text = RadTextBox1.Text; 
    6         Literal1.Text = string.Format("You entered: {0}.", text); 
    7     } 
    8
    9  


    If you have any further questions, please feel free to ask. I hope this has helped.

    Regards,
    Kevin Babcock
Back to Top