Click here to Skip to main content
13,141,838 members (62,995 online)
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.

Posted 16-Aug-12 22:40pm
Updated 19-Aug-12 18:20pm
adit_sheth 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: bad
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170915.1 | Last Updated 20 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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