I would like to do something like this in ASP.Net 2.0:
<asp:Repeater id="myRepeater" runat="server">
<ItemTemplate>
<% if (DataBinder.Eval(Container.DataItem, "MyProperty").Equals("SomeValue")) { %>
<%#DataBinder.Eval(Container.DataItem, "MyProperty")%>
<% } %>
</ItemTemplate>
</asp:Repeater>
But I cannot test the DataBinder.Eval(Container.DataItem, "MyProperty") like this.
NOTE: I don't have access to the source code, I can only change the aspx inline.
NOTE2: I know I can use this:
<%#DataBinder.Eval(Container.DataItem, "MyProperty").Equals("SomeValue")?"<!--":""%>
but I was looking for a cleaner way.
Is there a way to test the Container.DataItem with inline code inside a Repeater?