For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > November 2005 > Formatting not apply









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Formatting not apply
Esperanza

2005-11-29, 7:03 pm

Simple question.
The formatting code I use in my projet does not apply in my asp pages at
run time.
Any Idea Why ???
Thanks in advance !!!
Esperanza

Example 1
this.txtPrix.Text =
System.String.Format("{0:c}",dtrProduitVIPComposantPrix["sglPrixActuel"].ToS
tring());
result : 15.4567

Example 2
Another example this time in html to format a datagrig column in a pourcent
format

<asp:Label id=dg_lblPourc runat="server" Text='<%#
fctPourcComposant(DataBinder.Eval(Container, "DataItem.dblPourcentage")) %>'
DataFormatingString="{0:p}">
result :1.7876654433


Patrice

2005-11-29, 7:03 pm

I would try :
- to suppress "ToString" (in case 1 you are applying a numeric format to a
string as you used ToString)
- in case 2 try to specify the format as the 3rd argument of Eval (check the
doc but I don't remember to have seen a DataFormatingString member for the
Label control ?)

--
Patrice

"Esperanza" <esperanza222@hotmail.com> a écrit dans le message de
news:%23uNnRFP9FHA.3908@TK2MSFTNGP10.phx.gbl...
> Simple question.
> The formatting code I use in my projet does not apply in my asp pages at
> run time.
> Any Idea Why ???
> Thanks in advance !!!
> Esperanza
>
> Example 1
> this.txtPrix.Text =
>

System.String.Format("{0:c}",dtrProduitVIPComposantPrix["sglPrixActuel"].ToS
> tring());
> result : 15.4567
>
> Example 2
> Another example this time in html to format a datagrig column in a

pourcent
> format
>
> <asp:Label id=dg_lblPourc runat="server" Text='<%#
> fctPourcComposant(DataBinder.Eval(Container, "DataItem.dblPourcentage"))

%>'
> DataFormatingString="{0:p}">
> result :1.7876654433
>
>



Esperanza

2005-11-29, 7:03 pm

It's working (both)!!
Thank you so much !!
Esperanza

"Patrice" <nobody@nowhere.com> a écrit dans le message de
news:eJkqkYP9FHA.1292@tk2msftngp13.phx.gbl...
> I would try :
> - to suppress "ToString" (in case 1 you are applying a numeric format to a
> string as you used ToString)
> - in case 2 try to specify the format as the 3rd argument of Eval (check

the
> doc but I don't remember to have seen a DataFormatingString member for

the
> Label control ?)
>
> --
> Patrice
>
> "Esperanza" <esperanza222@hotmail.com> a écrit dans le message de
> news:%23uNnRFP9FHA.3908@TK2MSFTNGP10.phx.gbl...
at[color=darkred]
>

System.String.Format("{0:c}",dtrProduitVIPComposantPrix["sglPrixActuel"].ToS
> pourcent
> %>'
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com