Follow by Email

Monday, 22 April 2013

How to change the date format of a DataBinder.Eval (DataList) in asp.net?


Here is the example:

 <asp:DataList ID="dlistRightSide" runat="server">
                    <ItemTemplate>
                 
                           <ul>
                                <li><span><asp:Label ID="lblRightSideName" runat="server" ><%# DataBinder.Eval(Container.DataItem, "FirstName")%> &nbsp; <%# DataBinder.Eval(Container.DataItem,  " LastName ")%></asp:Label></span></li>
                                <li><asp:Label ID="lblRightSideJoinDate" runat="server" ><%# DataBinder.Eval(Container.DataItem, "CreatedDate", "{0:MMM d, yyyy}")%></asp:Label></li>
                                <li><asp:HyperLink ID="hlinkRightSideViewTree"  runat="server">View in Tree</asp:HyperLink></li>

                            
                            </ul>

                    </ItemTemplate>
                    </asp:DataList>

0 comments:

Post a Comment


                                                            

 
Design by Abhinav Ranjan Sinha