Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ToolTip in ASP.Net For Dropdown Control

Posted on 2004-08-31
2
Medium Priority
?
876 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

597 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