1.Eval限制字數web
<%# Eval("title").ToString().Length > 16 ? Eval("title").ToString().Substring(0, 16) + "..." : Eval("title")%>string
2.Eval作判斷it
2.1與值作判斷im
<%# Eval("flag").ToString() == "1" ? "CompanyInfolist.aspx" : (Eval("flag").ToString() == "2") ? "company/aaa/web/index.aspx" : (Eval("flag").ToString() == "3") ? "company/bbb/web/index.aspx" : "company/ccc/index.aspx"%>?UID=<%#Eval("infoID")%>img
2.2判斷爲空時間
<%# string.IsNullOrEmpty(Eval("Companylogo").ToString()) ? "<img src='../E_img/ao.jpg' width='212' height='200' />" : Eval("Companylogo")%>co
3.Eval取時間值asp
<%# Eval("addTime","{0:d}")%>index