I'm trying to use a C# if-statement in a transformation of a basic repeater with a SQLDataSource, like this:
<% if(IsFirst()) { %>
Some text <%# Eval("MyField")%> <% } %> This works fine. But if it comes to checking agains a field value, like this: <% if(Eval("MyField1").ToString()=="value") { %>
Some text <%# Eval("MyField2")%> <% } %> I'll get an server error. I want to avoid using K# statments like IfCompare, because then I have to put the whole output string into the function, which is becomes horrible when dealing with nested conditions. Can anybody help?