2012-04-10 143 views

回答

0

備用解決方案:使用Ajax DropDownExtender可以輕鬆更改css風格。

<ajaxToolkit:DropDownExtender runat="server" ID="DDE" 
TargetControlID="TextLabel" 
DropDownControlID="DropPanel" /> 

訪問此鏈接的演示:DropDown Demonstration

-1

這將在頁面加載

foreach(ListItem item in ddlName.Items) { 
    if(item.Value == "someStringValue") { 
     item.Attributes.Add("style", "color:red") 
    } 
} 

來完成。如果不工作,你可以將此代碼移動到下拉列表的數據綁定事件。

+0

存在dropdownbox的^箭頭。如果我點擊或懸停在其更改爲藍色。我怎樣才能把這個藍色變成其他顏色? – 2012-04-10 07:05:00

相關問題