Link to home
Start Free TrialLog in
Avatar of Jesper Christensen
Jesper Christensen

asked on

format eval data

Hi.

In my repeater, i have this;: <%# Eval("[\"Price\"]")%>

How can I format the price?

normally I do it like this from codebehind:
rs["TotalPris"].ToString("#,##0.00")
Avatar of HainKurt
HainKurt
Flag of Canada image

try:

<%# Eval("Price").ToString("#,##0.00")%>
Its the same as you do in code behind. Eval tag means server side functionality.
Avatar of Jesper Christensen
Jesper Christensen

ASKER

I get this error:

CS1501: no overload for the method 'ToString'
try:

<%# DataBinder.Eval(Container.DataItem, "Price", "{0:#,##0.00}") %>
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This one did the magic HainKurt: <%# DataBinder.Eval(Container.DataItem, "Price", "{0:#,##0.00}") %>
Thank you very much !!