?
Solved

ToolTip in ASP.Net For Dropdown Control

Posted on 2004-08-31
2
Medium Priority
?
875 Views
Last Modified: 2008-01-09
Hi All,

I need to create a ToolTip for a DropDown Control in ASP.Net.  I know there's a way to do this.  The DropDown control in ASP.Net does not have a ToolTip property, so I need to create one.  I don't want to insert JavaScript.  I'd prefer to do this in VB.Net code for the ASP.Net page.

I'm aware that the ToolTip control is a part of System.ComponentModel.Component on the VB Windows side, but I can't figure out how to add the ToolTip property to the DropDown control for an ASP.Net DropDown control.

Does anyone know how to do this for an ASP.Net DropDown control?

Thanks

0
Comment
Question by:RichW
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
vinayakrishna earned 1000 total points
ID: 11949921

Use this in your code-behind page:

ddl1.Attributes.Add("onmouseout","javascript:tooltip(0);");
ddl1.Attributes.Add("onmouseover","javascript:tooltip(1);");

where ddl1 is the name of the DropDownlist ASP.NET control.

In your .aspx page add the following:

<script language="Javascript">
  function tooltip(x)
   {
       if(x==1)
       {
       document.all.tooltip.innerText = 'This is an example';
       document.all.tooltip.style.visibility ="visible";
       }
       else
       {
         //A tootip must be unshown<BR>          
         document.all.tooltip.style.visibility ="hidden";
       }
   }
</script>


Add this within your 'form' tag ;

<div class="tip" id="tooltip"></div>

Also you can apply the style sheet of your choice for the tooltip text.
0
 
LVL 4

Author Comment

by:RichW
ID: 11953174
Thanks, vinayakrishna.

I'm home from work today, and I will try this tomorrow.

I want to pass in the string for the ToolTip.  The user will make a selection from the DropDown control.  I am parsing text from the SelectedItem.Text of their selection and using that to formulate the ToolTip.  How would I pass that into your <SCRIPT> function?

If this works I will up the points.  Thanks again for your help.

RichW
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question