Tho*_*sAJ 16 asp.net asp.net-mvc razor
因此,使用注释我的字段的默认标签是
[Display(Name = "Spent")]
但当然,根据上下文显示字段,我想在视图中将其更改为"花费$".
对于标签,MVC5脚手架产生......
@Html.LabelFor(model => model.Spend Amount, htmlAttributes: new { @class = "control-label col-md-2" })
所以标签是"花了".
如何让它在视图中"花费$"???
Ali*_*hşi 49
使用此重载LabelFor方法
@Html.LabelFor(model => model.SpendAmount, "Spent $", htmlAttributes: new { @class = "control-label col-md-2" })
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
22861 次 |
| 最近记录: |