如何在asp.net中显示/隐藏特定索引下拉列表的工具提示。 [英] How to show/hide tooltip for particular index of dropdown in asp.net.?

查看:56
本文介绍了如何在asp.net中显示/隐藏特定索引下拉列表的工具提示。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在asp.net.?

How to show/hide tooltip for particular index of dropdown in asp.net.?

推荐答案

中显示/隐藏特定索引下拉列表的工具提示如果您不想要工具提示,请在DropDownList中设置ListItem的title属性然后不要添加title属性。



Set title attribute for ListItem in DropDownList if you do not want tooltip then don't add title attribute.

<asp:dropdownlist id="ddlNoOfMonths" runat="server">
            <asp:listitem text="select1" value="item1" title="tooltip"></asp:listitem>
            <asp:listitem text="select2" value="item2"></asp:listitem>
        </asp:dropdownlist>





使用C#码。



using C# code.

for (int d = 0; d < DropDownListControlName.Items.Count; d++)
{
    DropDownListControlName.Items[d].Attributes.Add("title", DropDownListControlName.Items[d].Text);
}


这篇关于如何在asp.net中显示/隐藏特定索引下拉列表的工具提示。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆