2010-10-13 69 views
0

我有dropdownlist文本顯示和值作爲隱藏值。 當用戶選擇其他選擇時,我想要將值提示更改爲值。 嗯,我已經嘗試此代碼,但不能正常工作:指定屬性web控件

<asp:DropDownList ID="ddlBranch" runat="server" Width="350px" ToolTip='<% ddlBranch.Value %>'> 

顯示在Firefox下拉列表提示爲<%ddlBranch.Value%>

方面

+0

''<%= ddlBranch.Value%>'' – RPM1984 2010-10-13 10:16:05

回答

0

試試這個

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

     }