I am trying to set up a conditional statement for a particular value so that if the value is contained within the data set, it will append m2/kw but when its not it doesn't. I initially had this, but obviously it was still adding the "m2/kw" even if the value wasn't present.
<%#Eval("powerOutput") + "m<sup>2</sup>/kW" %>
So I rewrote it, and it still doesn't work.
<%#Eval("powerOutput").ToString() == "" ?
Eval("powerOutput") + "m<sup>2</sup>/kW" : "" %>
Edit
<% if (Eval("powerOutput") != null)
{ %>
<%#
Eval("powerOutput") + "m<sup>2</sup>/kW" %>
<% }
else { %> <% } %>
I've now got to this, but I'm now getting an error with
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.