开发者

Assign attribute web control

开发者 https://www.devze.com 2023-01-19 23:48 出处:网络
I have dropdownlist with text to display and value as hidden value. I want keep changing value tooltip as value when user select other selection.

I have dropdownlist with text to display and value as hidden value. I want keep changing value tooltip as value when user select other selection. Well, I am already try this code but not work properly:

<asp:Dro开发者_C百科pDownList ID="ddlBranch" runat="server" Width="350px" ToolTip='<% ddlBranch.Value %>'>

Display in firefox dropdownlist tooltip as <% ddlBranch.Value %>

Regard


Try this

for (int i = 0; i <= DropDownList1.Items.Count - 1; i++)
      {
        DropDownList1.Items[i].Attributes.Add("Title", DropDownList1.Items[i].Text);

      }
0

精彩评论

暂无评论...
验证码 换一张
取 消