Solved

ToolTip in ASP.Net For Dropdown Control

Posted on 2004-08-31
2
873 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 250 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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
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…

724 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