MVC 显示字段名称
@model Tianli.Models.tbInstrument
@{
ViewBag.Title = "Details";
}
<h2>Details</h2>
<div>
<h4>tbInstrument</h4>
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.Company_Cod)
</dt>
<dd>
@Html.DisplayFor(model => model.Company_Cod)
</dd>
其中,
public class tbInstrument
{
#region Model
/// <summary>
///
/// </summary>
[Key]
public Guid Id { get; set; }
/// <summary>
///
/// </summary>
[Column("公司名称")]
public string Company_Cod { get; set; }
/// <summary>
///
/// </summary>
[Column ("设备名称")]
public string Instrument_Name { get; set; }
}
有没有让
@Html.DisplayFor(model => model.Company_Cod)
显示的Column 中的名称呢,而不是显示英文字段名称