Click here to Skip to main content
15,904,023 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
what should i add to this label to view "$" beside the unitcost?? thanks

ASP.NET
<asp:Label ID="UnitCostLabel" runat="server" Text='<%# Eval("UnitCost") %>'></asp:Label>
Posted
Comments
Richard C Bishop 7-May-13 15:30pm    
You can either type a "$" next to the label or add it to the Text property.
[no name] 7-May-13 15:44pm    
i try it but it didnt work
[no name] 7-May-13 15:44pm    
how could i add it to the text property?
joshrduncan2012 7-May-13 15:53pm    
Rich is on to something. Create a new label and stick it right next to the left of the other label and just have the $ sign be the only text in it.
[no name] 7-May-13 15:55pm    
nice idea ill try it thanks :)

$<asp:label id="UnitCostLabel" runat="server" text="<%# Eval(" unitcost")="" %&gt;"="" xmlns:asp="#unknown">
 
Share this answer
 
You can use
<%# Eval("UnitCost", "{0:c}") %>
to format your value to currency format
 
Share this answer
 
Try like this ..
<asp:label id="UnitCostLabel" runat="server" Text='<%# "$ " + Eval("UnitCost") %>'></asp:label>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900