请教:请菜的语法问题,请大家帮忙?
在datalist里想使用函数:
public string getroomstate(string s)
{
string roomstate= " ";
if (s == "1 ") { roomstate = "未订 "; }
if (s == "2 ") { roomstate = "已订 "; }
return roomstate;
}
<%=getroomstate( <%# DataBinder.Eval(Container, "DataItem.ST_Status ")%> ) %>
显然:
<%=getroomstate( <%# DataBinder.Eval(Container, "DataItem.ST_Status ")%> ) %>
是错的.请问应该怎样改呢?
------解决方案-------------------- <%# getroomstate(DataBinder.Eval(Container, "DataItem.ST_Status ")) %>