Asp.Net (C #) inline encoding Eval if instruction problem
2 answers
What? at the end it looks like you are going for a ternary operator, but you haven't finished it yet.
Personally, in this situation, I like to use a visible property, for example:
<asp:ImageButton ID="imgEdit" runat="server" ImageUrl="../icons/icoedit.png"
CommandName="Edit" Visible='<%# Eval("NAME").ToString() == "Edit" %>'
CommandArgument='<%# Container.DataItemIndex %>' />
Or if you want the opposite
<asp:ImageButton ID="imgEdit" runat="server" ImageUrl="../icons/icoedit.png"
CommandName="Edit" Visible='<%# Eval("NAME").ToString() != "Edit" %>'
CommandArgument='<%# Container.DataItemIndex %>' />
0
a source to share