【发布时间】:2011-12-01 09:34:17
【问题描述】:
我的视图中有这一行:
@Html.EditorForModel()
这是我的 ViewModel:
public class CommentForm
{
public int Id { get; set; }
[DisplayName("Kommentar"), DataType(DataType.MultilineText)]
public string Comment { get; set; }
}
问题是Id 在表单中呈现为文本字段。实际上,我只想在表单操作中使用Id。是否有一个属性告诉编辑器不要渲染属性Id?
【问题讨论】:
标签: asp.net-mvc asp.net-mvc-3 data-annotations