asp.net asp 经过 eval 绑定 数据 使用 三元运算 栏目 ASP 繁體版
原文   原文链接

Label控件绑定数据时,经过三元运算符改变字体的颜色: 字体

<asp:Label ID="lb_hname" runat="server" Text='<%#Eval("HotelName") %>'
ForeColor='<%#(Convert.ToInt32(Eval("RowIndex", "{0}")) <=3) ? System.Drawing.Color.Red : System.Drawing.Color.Blue%>'></asp:Label>
相关文章
相关标签/搜索
每日一句
    每一个你不满意的现在,都有一个你没有努力的曾经。
本站公众号
   欢迎关注本站公众号,获取更多信息