不支持字符串格式 [英] String formatting is not supported

查看:112
本文介绍了不支持字符串格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI Friends,

我一直在使用MVC,我已经创建了局部视图并从模型中渲染了内容.

但是当我将其设置为string.format时,它没有被格式化.

我将参考的示例代码.

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">
           <%=result.ShowYear%>
       </td>
       <td align="left">
           <%=string.Format("{0:c}",result.ShowProjectRevenu)%>
       </td>
   </tr>



普通的巧克力酱正在显示
我也尝试过泳镜操作,但不明白为什么该格式不适用于字符串.

请帮帮我.

谢谢



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.

Thanks

推荐答案

您有string.formate.它是string.Format. <%=是ASP.NET语法,我不知道它是否甚至可以在MVC3中使用,您应该使用Razor语法,它更具可读性,如果您这样的人,像我这样的人将能够更好地为您提供帮助重新使用其他人.
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.


这篇关于不支持字符串格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆