User107

User107

  • NA
  • 28
  • 17.8k

Is It possible to show tooltip on dropdown in asp.net

Sep 22 2016 7:34 AM
In my web application, i have dropdowncheckboxes control but i am trying to show tooltip on selectbox items. Is is possible to do.
 

I am tried code:

.aspx:

<link rel="stylesheet" href="css/bootstrap-3.1.1.min.css" type="text/css" />
<link href="https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script>
$
(function () {
$
("#tooltip1").tooltip(); });
</script>
<div class="tooltip1">
<asp:DropDownCheckBoxes ID="dropdown1" runat="server" UseSelectAllNode="true" UseButtons="true"
OnSelectedIndexChanged="dropdown1_SelectedIndexChanged" AutoPostBack="true">
<Style SelectBoxWidth="200" DropDownBoxBoxWidth="200" DropDownBoxBoxHeight="130" />
<Texts SelectBoxCaption="" /> </asp:DropDownCheckBoxes> <asp:Label runat="server" ID="tooltip1"></asp:Label>

.CS:

protected void Page_Load(object sender, EventArgs e)
 {
tooltip1
.Text = dropdown1.Texts.SelectBoxCaption;
 }
protected void dropdown1_SelectedIndexChanged(object sender, EventArgs e)
{
List<String> checkedList = new List<string>();
foreach (ListItem item in dropdown1.Items)
{
if (item.Selected)
 {
checkedList
.Add(item.Value);
}
 }
dropdown1
.Texts.SelectBoxCaption = String.Join(",", checkedList.ToArray());
}

tooltip is not displayed can anyone tell me where i did mistake i don't know. Is there any events to display tooltip

Thank you

 

Answers (4)