Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 13, 2012 05:50 AM by Frank Jiang - MSFT
Participant
1656 Points
1345 Posts
Nov 06, 2012 01:04 PM|LINK
using asp.net/vb.net 2010
I need to bind a value to a .net control and do the string formatting but the code below is throwing an error. whats the correct syntax for this? what I have is below:
<asp:TextBox ID="txtProdPrice" runat="server" Text='<%# String.Format("{0:f2}",DataBinder.Bind("ProductPrice"))%>' > </asp:TextBox>
thanks
MC
All-Star
31257 Points
6389 Posts
Nov 06, 2012 01:34 PM|LINK
16006 Points
1728 Posts
Microsoft
Nov 13, 2012 05:50 AM|LINK
This works for me:
Text='<%# Eval("ProductPrice", "{0:f2}") %>'
MyronCope
Participant
1656 Points
1345 Posts
bind to label in gridview and do string formatting
Nov 06, 2012 01:04 PM|LINK
using asp.net/vb.net 2010
I need to bind a value to a .net control and do the string formatting but the code below is throwing an error. whats the correct syntax for this? what I have is below:
<asp:TextBox ID="txtProdPrice" runat="server" Text='<%# String.Format("{0:f2}",DataBinder.Bind("ProductPrice"))%>' > </asp:TextBox>thanks
MC
oned_gk
All-Star
31257 Points
6389 Posts
Re: bind to label in gridview and do string formatting
Nov 06, 2012 01:34 PM|LINK
Frank Jiang ...
All-Star
16006 Points
1728 Posts
Microsoft
Re: bind to label in gridview and do string formatting
Nov 13, 2012 05:50 AM|LINK
This works for me:
Text='<%# Eval("ProductPrice", "{0:f2}") %>'
Feedback to us
Develop and promote your apps in Windows Store