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")
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("
Its the same as you do in code behind. Eval tag means server side functionality.
ASKER
I get this error:
CS1501: no overload for the method 'ToString'
CS1501: no overload for the method 'ToString'
try:
<%# DataBinder.Eval(Container. DataItem, "Price", "{0:#,##0.00}") %>
<%# DataBinder.Eval(Container.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This one did the magic HainKurt: <%# DataBinder.Eval(Container. DataItem, "Price", "{0:#,##0.00}") %>
Thank you very much !!
Thank you very much !!
<%# Eval("Price").ToString("#,