C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Tool tip for DropDownList in ASP.NET


Posted Date: 27 Nov 2007    Resource Type: Code Snippets    Category: ASP.NET WebForms

Posted By: Bharathi       Member Level: Diamond
Rating:     Points: 10



In ASP.NET, server side controls like listcontrols, dosen't have property for tooltip text. However, you can use the following code sample to show tooltips for ASP.NET controls.

Place the DropDownList or any list control in a <DIV></DIV> tag.

If you like to have a common tool tipe for the entire dropdown list contorl, then set the Title attribute for the DIV control. if you like to have a tool tip for each item in the List, then set the Title for each item in the list:


for(int i=0; i<=DDL.items.count-1; i++)
{
DDL.Item[i].Attributes.Add("Title", DDL.Item[i].Text)
}




Responses

Author: mruthunjaya    08 Jan 2008Member Level: Bronze   Points : 0
The code mentioned is not working for Drop down list in VS 2005.



Author: Bharathi    19 May 2008Member Level: Diamond   Points : 2
The code will work with ASP.Net 2.0 as well ASP.Net 1.1.
But you may not be able to see the ToolTip text of dropdownlist items in IE 6.0. it Works with higher version of IE.

Thanks.


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Cross Page Postback in ASP.NET 2.0
Previous Resource: Delete confirmation message in a datagrid.
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

SPOC

Contact Us    Privacy Policy    Terms Of Use