Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data formatting expressions
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00899351
Message ID:
00899574
Vues:
14
Hi Chris,

Javascript can be used to provide the formatting you need.
string DisplayPhone(string s) {
   return s.Substring(0,3) + "-" + s.Substring(3,3) + "-" + s.Substring(6);
}
You can call a helper function inside a "<%# %>" construct like so:
<%# DisplayPhone(DataBinder.Eval(Container.DataItem, "Phone", "{0}")) %>
>I am having a little problem understanding the way data formatting expressions work in .NET
>
>I am trying to add formatting to my fields from the grid's properties window. I would like to add formatting to a phone number field to be displayed like this (123) 456-7890
>
>Could you give me a hand with this? Thank you in advance.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform