Re: DataFormatString is ignored on on some servers

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On 29 Mar, 05:11, jonefer <jone...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Is their any particular reason (server or design?) why the following line
won't work on some servers?

This is code within a Gridview control
<asp:BoundField DataField="Regional Target" DataFormatString="{0:#%}"
HeaderText="Regional Target"

This code works on my development machine VS Studio 2005 and Microsoft
Visual Studio 2005
Version 8.0.50727.762  (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727 SP1

What I am getting is unformated 'real' numbers... i.e. 0.638354978354978
instead of 64%.  

Something to note is that font weighting like bold or underlining  or
anti-aliasing is also not taking place on this server, although the correct
choice of font IS.  

I have a hunch that there is a setting on a server that doesn't- allow such
formatting in favor of faster rendering therefore, less 'load' on the server?

If not, what causes the server to completely ignore the
DataFormatString="{0:#%}"   ?

Hi

I don't know why there should be any difference between the server to
the development machine (I doubt it has anything to do with
restrictive settings) but there is a standard numeric format specifier
for percentages in ASP.NET.

Try "{0:P0}" which will muliply by 100, round to the number of decimal
places specified (in this case 0) and add the % symbol.

HTH
.



Relevant Pages

  • Re: Slow booting xp home.
    ... The microsoft fax one appears twice at every boot. ... The LexBce Server service terminated unexpectedly. ... Windows is loading will come on and then the desktop, ... Visual Studio Source Control and SourceSafe -» ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Slow booting xp home.
    ... I assume Microsoft Fax is not working. ... LexBce Server service is used by some Lexmark and some Dell printers. ... Windows is loading will come on and then the desktop, ... Visual Studio Source Control and SourceSafe -» ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Slow booting xp home.
    ... I assume Microsoft Fax is not working. ... The LexBce Server service terminated unexpectedly. ... Windows is loading will come on and then the desktop, ... Visual Studio Source Control and SourceSafe -» ...
    (microsoft.public.windowsxp.perform_maintain)
  • SecurityFocus Microsoft Newsletter #49
    ... Subject: SecurityFocus Microsoft Newsletter #49 ... Microsoft Windows NNTP Denial of Service Vulnerability ... Microsoft IIS SSI Buffer Overrun Privelege Elevation Vulnerability ... Microsoft ISA Server H.323 Memory Leak Denial of Service... ...
    (Focus-Microsoft)
  • Re: Slow booting xp home.
    ... The LexBce Server service terminated unexpectedly. ... Windows is loading will come on and then the desktop, ... I read somewhere that Microsoft ... Visual Studio Source Control and SourceSafe -» ...
    (microsoft.public.windowsxp.perform_maintain)