1.这个判断的过程你可以写在后台,如先在后台写一个public类型的方法:public bool CheckAduit(string code){ //根据你传入的code来判断,并返回true或者false} 然后绑定这里写:<%#CheckAduit(Convert.ToString(Eval(‘isaduit‘)))%> 2.直接写 三元表达式<%# Convert.ToString(Eval(‘isaduit‘))=="0"?"是"?"否"%> 3.在这个Repeater的DataRowBind事件里进行替换。<td><% string color = Eval("color").ToString();
switch (color)
{
case "4a1":
Response.Write("<font color=‘#5f1a1f‘>" + Eval
("smallType") + "<br />" + Eval("otherColor") + "</font>");
break;
case "4a2":
Response.Write("<font color=‘#ba6525‘>" + Eval
("smallType") + "<br />" + Eval("otherColor") + "</font>");
break;
case "4a3":
Response.Write("<font color=‘#bd8256‘>" + Eval
("smallType") + "<br />" + Eval("otherColor") + "</font>");
break;
case "4a8":
Response.Write("<font color=‘#980808‘>" + Eval
("smallType") + "<br />" + Eval("otherColor") + "</font>");
break;
case "4a11":
Response.Write("<font color=‘#791418‘>" + Eval
("smallType") + "<br />" + Eval("otherColor") + "</font>");
break;
case "4a14":
Response.Write("<font color=‘#a32496‘>" + Eval
("smallType") + "<br />" + Eval("otherColor") + "</font>");
break;
default:
Response.Write("" + Eval("smallType") + "<br />" +
Eval("otherColor") + "");
break;
}
%></td>