or
Dear Forum,
I found this german blog http://www.encodo.info/en/blogs.php?entry_id=156
Now I like to know with way of the next to is faster. Hope you can help me to understand.
Thank U for help
Best from
Dieter
1st
<asp:DataList ID=“_myList” runat=“Server”>
<ItemTemplate>
<asp:Label … Text=‘<%# GetFormattedDate(Eval(“Birthday”)) %>’></asp:Label>
</ItemTemplate>
</asp:DataList>
CodeBehind:
public partial class MyPage : System.Web.UI.Page { protected String GetFormattedDate(object date) { if (date is DateTime) { return ((DateTime)date).ToShortDateString(); } return String.Empty; } }
2nd
<asp:DataList ID=“_myList” runat=“Server”>
<ItemTemplate>
<birth:day id="birth001" runat="server" Birthday=‘Eval(“Birthday”) %>’/>
</ItemTemplate>
</asp:DataList>
ascx
<asp:Label ID="L_Birthday" runat="server" ></asp:Label>
public partial class UserControls_birthday : System.Web.UI.UserControl
{
public DateTime bday{
set
{
L_Birthday.text = value.ToShortDateString();
}
}