日期:2014-05-18  浏览次数:20605 次

运算符>无法应用与string和int
<asp:Label ID="LbProductMaterial" runat="server" Text='<%# " <tr height=20><td align=center width=62>产品材质:</td><td align=left width=100><a href=ProductShow.aspx?id="+Eval("id")+">" + Eval("Material").ToString().Length>5?(Eval("Material").ToString().Substring(0,5)):(Eval("Material")) +" </a><td> </tr>" %>' Visible="False"></asp:Label> 


哪错了?我感觉都对.

------解决方案--------------------
<asp:Label ID="LbProductMaterial" runat="server" Text=' <%# " <tr height=20> <td align=center width=62>产品材质: </td> <td align=left width=100> <a href=ProductShow.aspx?id="+Eval("id")+">" +( Eval("Material").ToString().Length>5?(Eval("Material").ToString().Substring(0,5)):(Eval("Material"))) +" </a> <td> </tr>" %>' Visible="False"> </asp:Label>