Tagged Posts with: zip code

Format String with String.Format and C#

January 3rd, 2009 | Posted in ASP.NET
4

<%# String.Format("{0:#####-####}", Convert.ToInt32(Eval("ZipCode"))) %> It is necessary to convert the ZipCode field to an integer in this instance because the Format class expects an integer to properly format a number, otherwise it will only return the string or value that you passed to the Format class. I am using this in conjunction with the MaskedEditExtender, ...