2
<asp:Repeater ID="rptEntries" runat="server" DataSourceID="dsEntries">
<ItemTemplate>
<%
if (Convert.ToInt16(Eval("entryWinner")) == 1)
{
%>
<%# "<div class=\"imgThumb draggable\" style=\"background-image:url('uploads/"
+ Eval("entryImagename") + "');\" data-id=\"" + Eval("pk_entryId")
+ "\"></div>"
%>
<%
}else{
%>
<%# "<div class=\"imgThumb draggable\" style=\"background-image:url('uploads/"
+ Eval("entryImagename") + "'); filter: grayscale(100%);\" data-id=\""
+ Eval("pk_entryId") + "\"></div>"
%>
<%
}
%>
</ItemTemplate>
</asp:Repeater>
我想顯示之前檢查entryWinner TE的價值,但它給格蘭以下錯誤:檢查值槽IF直放站
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.