我正在使用这个,一个编辑器模板(位于我的解决方案的 Shared\EditorTemplates 文件夹中)
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime?>" %>
<%=Html.TextBox("", (Model.HasValue ? Model.Value.ToString("MM/dd/yyyy") : string.Empty), ViewData )%>
这在我看来
@Html.EditorFor(model => model.ModifiedDate)
如何使该字段在视图中只读