I'm trying to modify text in an ASCX file based on the value chosen in a grid. This syntax doesn't work.
<p>
The letter should be <%#If(DataBinder.Eval(Container.DataItem, "Code") == "A" Then A Else B)%>
</p>
This should render as "The letter should be A" or "The letter should be B". Can this be done dynamically? The grid is on the same ascx page.
Well, if that markup is to be inside of a grid view?
Then you still have to template that column.
So, say this:
So, if the data (city column) = "Edmonton", then we show "E", else we show the value.
And that's not code - but has to be a legal single VB expression.
So, if() or iif() is a vb.net function - they are both the same - and there is no "then" or "else" when you use that function.