Hi,
I just want to add another simple way to display data with specified format using Eval and Bind...
If your label is bound to some data source you can format display through markup.
Example:
<asp:label id="Label1" runat="server" text="<%# Eval("DateTimeDataFieldName", "yyyy-MM-dd")%>" xmlns:asp="#unknown"></asp:label>
Eval method is defined as:
protected internal string Eval(
string expression,
string format
)
so you can use any other
format string. For all format strings definition refer to
documentation [
^].