I want to show some specific code if a value is set, else show nothing.
I have used this before, however it was only to show a heading and it worked fine.
Now I need to show a list item, an a tag and an value from a field.
Below is my code:
<%# IfEmpty(Eval("sciBuyOnline"), "", "<li><a href="<%# Eval("sciBuyOnline") %>" title="Buy <%# Eval("sciName") %> Online Now!">Buy Now</a></li>") %>
In summary, if the field 'sciBuyOnline' is empty, it should show nothing else it should output the following code:
<li><a href="<%# Eval("sciBuyOnline") %>" title="Buy <%# Eval("sciName") %> Online Now!">Buy Now</a></li>
The error I am getting is this:
[CMSDataProperties.LoadTransformation]: http://server/CMSTransformations/a0e429b5-9878-481f-838e-4df23bea2557/custom/softwarecatalogueitem/default.ascx(27): error CS1040: Preprocessor directives must appear as the first non-whitespace character on a line
Does this mean I cannot use whitespace at all in my outputted code? Please help me :)