B
Bruno Alexandre
Hi guys,
How can I perform a check if a binded field is Empty or Null, like this:
<asp:TemplateField HeaderText="Birthdate" SortExpression="bdC">
<ItemTemplate>
<% If Not String.IsNullOrEmpty(Eval("bdC")) Then%>
<%#(FormatDateTime(Eval("bdC"), DateFormat.ShortDate))%>
<% Else%>
<% end if %>
</ItemTemplate>
</asp:TemplateField>
if I try the above code, I get this error:
"Databinding methods such as Eval(), XPath(), and Bind() can only be used in
the context of a databound control."
Thank you
How can I perform a check if a binded field is Empty or Null, like this:
<asp:TemplateField HeaderText="Birthdate" SortExpression="bdC">
<ItemTemplate>
<% If Not String.IsNullOrEmpty(Eval("bdC")) Then%>
<%#(FormatDateTime(Eval("bdC"), DateFormat.ShortDate))%>
<% Else%>
<% end if %>
</ItemTemplate>
</asp:TemplateField>
if I try the above code, I get this error:
"Databinding methods such as Eval(), XPath(), and Bind() can only be used in
the context of a databound control."
Thank you