aspx文件中 < td width ="11%" align ="center" class ="xtd" > <% ... # Get_Center(Convert.ToInt32(DataBinder.Eval(Container.DataItem,"Center"))) %> </ td > CS文件中 protected static string Get_Center( int Center) ... { string returnvalue; if(Center==0) ...{ returnvalue = "<font color=Blue>否</font>"; } else ...{ returnvalue = "<font color=Red>是</font>"; } return returnvalue; }