Solved

ToolTip in ASP.Net For Dropdown Control

Posted on 2004-08-31
2
867 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
2 Comments
 
LVL 1

Accepted Solution

by:
vinayakrishna earned 250 total points
Comment Utility

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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
External app config and encryption of settings 1 49
Problem to picture file 3 37
Trouble with References... 5 21
Showdialog 8 20
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now