Grid with Eval expressions
I use a Telerik RadGrid control and various 'Eval' expressions to show data in my aspx pages:
<开发者_运维百科;div>
Number: <%# Eval("AccountNumber")%>
</div>
<div>
File: <%# Eval("AccountFile")%>
</div>
...
Sometimes my DataSet is empty (ie. the AccountFile may be missing). How do I write the aspx code so as not to show the Div at all if the expression for the Eval is null or empty?
<%# if(Container.DataItem != null){%>
<div>
Number: <%# Eval("AccountNumber")%>
</div>
<div>
File: <%# Eval("AccountFile")%>
</div>
<%}%>
精彩评论