C#:
dob:
<asp:Label
ID="dobLabel" runat="server" Text='<%# Eval("dob")==DBNull.Value
? "N/A": Eval("dob","{0:d}")
%>'></asp:Label>
<asp:Label
ID="Label3" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "dob")==DBNull.Value ?
"N/A": DataBinder.Eval(Container.DataItem,
"dob","{0:d}") %>'></asp:Label><br />
VB.NET:
dob:
<asp:Label
ID="dobLabel" runat="server" Text='<%#
IIF(Eval("dob") IS DBNull.Value,"N/A",
Eval("dob","{0:d}")) %>'></asp:Label>
or
<asp:Label
ID="Label3" runat="server" Text='<%#
IIF(DataBinder.Eval(Container.DataItem, "dob") IS DBNull.Value,
"N/A", DataBinder.Eval(Container.DataItem,
"dob","{0:d}")) %>'></asp:Label><br />
C#
<%# DataBinder.Eval(Container.DataItem,
"RecentDate") == "{1/1/0001 12:00:00 AM}" ? "n/a"
: DataBinder.Eval(Container.DataItem, "RecentDate",
"{0:d}")%>
Text='<%# Eval("RecentDate") ==
DBNull.Value ? "n/a": Eval("RecentDate","{0:d}")
%>'
Text='<%#
Convert.ToString(Eval("myDatetime")) =="1/1/0001 12:00:00
AM" ? "N/A" : Eval("myDatetime",
"{0:d}")%>'