2011-06-18 66 views

回答

3

嘗試使用Expressions

<asp:Button ... BackColor=<%# Eval("Party") = "Republican" ? "Red" : "Blue" %> ... /> 

這裏,BackColor無論何時發生RowDataBound事件,財產都將根據Party值採取適當的值。

相關問題