Click here to Skip to main content
14,388,816 members
Rate this:
Please Sign up or sign in to vote.
See more:
HI Friends,

I have been using the MVC i have created the partial view and rendering the content form the model.

but when i making it string.format it is not formatted.

sample code i am placing for the referance.

<tr bgcolor="#ffeadf">
       <td align="left">
       <td align="left">

the plain contantes are displaying
I have tried goggling also but not understand why that format is not applying on the string.

Please help me.

Updated 19-Aug-12 19:20pm
AditSheth 17-Aug-12 4:47am
is your spell for format is correct? and also F is in Upper letter.
deepakaitr12345 18-Aug-12 7:41am
Thanks for the reply.I have placed the string.Format correctly

the problem was solved by using the following statements

1)Add the name space System.globlization

2) <%="$ "+result.ShowProjectRevenu.ToString("0,0", CultureInfo.InvariantCulture)+".00"%>


1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

you have string.formate. It's string.Format. <%= is ASP.NET syntax, I don't know if that even works in MVC3, you should use Razor syntax, it's more readable and people like me will be better able to help you if you're using what everyone else is.

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100