I am looking to evaluate two strings from my dataset to identify a class description using a ternary operator. I continue to get a compiler error when running this code stating
Try this
<%#Eval("Status").ToString()=="1" ? "ClubMember" : "Free User" %>
I think the problem is that you are trying to do comparison between two strings. Just convert the values to a int or something similar for comparison. So for example, change your comparison to something like the below:
<td class="<%# (Convert.ToInt32(Eval("Team1Score")) > Convert.ToInt32(Eval("Team2Score"))) ? 'Winner':'' %>"><%# Eval("Team1")%></td>
Or you can just cast it to the appropriate type:
<td class="<%# ((int)Eval("Team1Score") > (int)Eval("Team2Score")) ? 'Winner':'' %>"><%# Eval("Team1")%></td>
Hope this helps!