给DropDownList添加ToolTip(title)属性

实现过程,只是为DropDownList控件写OnDataBound事务

protected void ddlCompany_DataBound(object sender, EventArgs e)
        {
            DropDownList ddl = (DropDownList)sender;
            for (int i = 0; i < ddl.Items.Count; i++)
            {
                ddl.Items[i].Attributes.Add("title", ddl.Items[i].Text);
            }

        }

 

转自http://www.mysjtu.com/page/M0/S651/651138.html

你可能感兴趣的:(tooltip)