ToolTips in ASP.NET AJAX
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
- Made for IT - September 11th, 2008
- Website cu efect de bumerang - July 11th, 2008
- Document manager (php free scripts) - June 23rd, 2008
- Cand faci milionul de EURO? - June 13th, 2008
- Un dublu click pentru DEX (Wordpress) - May 15th, 2008
Leave a Comment