views:

72

answers:

1

How can I achieve the desired effect? Here's the code:

<% if(!String.IsNullOrEmpty(%><%#Eval(Container.DataItem,"OrderXml");%><%)){ %>

etc., which is placed inside of an ItemTemplate inside of a TemplateColumn. In the CodeBehind page I will bind a value to the OrderXml field, which occasionally is NULL.

Unfortunately I get compilation errors.

A: 

Just remove the brackets before Eval:

<%# if(!String.IsNullOrEmpty(Eval(Container.DataItem,"OrderXml") ...

Antony Highsky
This did not work for me.Here's the whole code:<%# if(!String.IsNullOrEmpty(Eval(Container.DataItem,"ResponseXml"))){%><a id="<%# DataBinder.Eval(Container.DataItem,"OrderNumber")+"ResponseXml" %>" href="javascript:void(0)" onclick="show('<%# DataBinder.Eval(Container.DataItem,"OrderNumber")%>','ResponseXml')">[Show]</a><%# }else{ %><B>NULL</B><%# } %>No combination of '<%'s with '#'s seems to make the compiler happy.
scott