【发布时间】:2016-02-06 10:18:39
【问题描述】:
在剃刀视图中,我使用模型来渲染标签,例如
@Html.LabelFor(model => model.MyName, htmlAttributes: new { @class = "control-label col-md-6" })
现在我想使用它的值而不是数据注释属性。值,所以我尝试了 DisplayFor 之类的
@Html.DisplayFor(model => model.MyName, new { @class = "control-label col-md-6" })
此 css 类 control-label col-md-6 不适用。
为什么?
【问题讨论】:
标签: c# .net asp.net-mvc razor