後臺改變repeater html標籤的style

<td align="center" runat="server" style='<%# GetStyle((string)Eval("M_Mark")) %>'><%#DataBinder.Eval(Container.DataItem,"M_Mark"%></td>
//後臺方法
  protected string GetStyle(string type)
        {
            if (type == "已查看")
                return "color:green";
            else
                return "color:red";
        }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章