ToolTips in ASP.NET AJAX

By Marius Dima on Friday, November 23rd, 2007
Save demo files here

Step 1: Build and add  javascript file script.js ( function TT {// display the tooltip} & function findPos {// we have a position for it})
<asp:ScriptManager ID=”ScriptManager1″ runat=”server”>
<Scripts><asp:ScriptReference path=”scripts.js” /></Scripts> Step 2: Add  label
<ID=”label1″ runat=”server” Text=”I’m a tool tip. Mouse over me”/>

 Step 3: Make the tooltip
<
asp:Panel ID=”Panel1″ runat=”server” Width=”342px” style=”display:none; >
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC,
making it over 2000 years old.
</asp:Panel>

Step 4:
 Add some attributes to the asp.net label 
        label1.Attributes.Add(”onmouseover”, “TT(’Panel1′, this);”)   ‘ when the mouse is over this label the we will show tooltip from Panel 1
        label1.Attributes.Add(”onmouseout”, “TT(’Panel1′, this);”)   
‘ when the mouse is over this label the we will HIDE tooltip from Panel 1

Step 5:
  Press F5 and smile :)  it’s workin’
     
UPDATES:
I published also on the CODE PLEX for more development or future releases
http://www.codeplex.com/AjaxToolTips

Am mai scris despre javascripting

 

Leave a Comment