Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WebForms DisplayFormat property
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01018449
Message ID:
01019674
Views:
22
Glenn,

>I have set the displayformat property to MM/dd/yyyy and rather than the bound value appearing in the web browser, the MM/dd/yyyy appears. If I remove the displayformat string the correct datetime value appears in all its verbose glory. Ok, I give up what did I do wrong?

The Web Forms <>mmTextBox and mmLabel classes both have a DisplayFormat property which allows you to format display values on web pages.

The DisplayFormat property uses String.Format() expressions to format the display value (similar to what you use when formatting columns in a Web DataGrid). So, for example, to format the date to MM/dd/yyyy you set the property to:
{0:d}
For more information on formatting strings check out these topics:

Standard DateTime Format Strings Output Examples

Standard Numeric Format Strings Output Examples

I will add this information to the next version of the MM .NET Dev Guide.

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform