Donate

Format Date Values Shown In Label Control Inside An ASP.NET Web Forms Gridview

Reference: Set Date Format in Gridview
To format date as short date format of a label control inside a template field use Bind() as shown below:
1:  <ItemTemplate>  
2:    <asp:Label id="lblDateRec" runat="server" Text='<%#   
3:    Bind("GeneratedDateRec", "{0:MM/dd/yyyy}") %>'></asp:Label>  
4:  </ItemTemplate>  

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.

Invalid nested tag div found, expected closing tag input