in

Dot Net Mafia

Group site for developer blogs dealing with (usually) .NET, SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, MOSS 2007, ASP.NET, LINQ, and Visual Studio 2012.

Formatting Columns using Bind

If you are using two-way data binding (whether it is a formview, gridview, etc), you may find a place where you need to format a column such as a date. Bind has a second parameter which accepts typical bind expressions.

For example, to format a date, do something like this:

<%# Bind("MyDateColumn", "{0:d}") %>

Special thanks to Bobby for the contribution.

Read the complete post at http://www.dotnettipoftheday.com/blog.aspx?id=311

2012 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems