Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WebForms DisplayFormat property
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01018449
Message ID:
01019674
Vues:
23
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform