Learn How to work with ToolTip for Dropdown List:

ToolTip for Dropdown List:


Now in this post we take a example and display data astooltip of each item of list.
Example of use tooltip in dropdownlist:
Consider a sql data base table and bind dropdownlist. Then create dropdownlist  DataBound function and bind name to tool tip title. Here we give the asp.net code also.



Tooltip Example of dropdownlist item code :


<%@ Page Language="C#" AutoEventWireup="true"CodeFile="DropDownlist_Item_tooltip.aspx.cs" Inherits="DropDownlist_Item_tooltip" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Bind Tooltips for Dropdownlist</title>
    <style type="text/css">

 p.MsoNormal
       {
       margin-top:0in;
       margin-right:0in;
       margin-bottom:10.0pt;
       margin-left:0in;
       line-height:90%;
       font-size:14.0pt;
       font-family:"Calibri","sans-serif";
       }
    </style>
</head>
<body>
<form id="form1" runat="server">
<div align="center">
    <br />
   
<h2>Example of Adding ToolTip for each DropdownList Item in C#</h2>
    <p><strong>Select State here</strong></p>
    <br />
    <br />
<asp:DropDownList ID="ddlist" runat="server" ondatabound="ddlist_DataBound"
        onselectedindexchanged="ddlist_SelectedIndexChanged"/>
</div>
</form>
</body>
</html>


Learn How to work with Asp.net and C#:

Comments