Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
@Html.LabelFor(model => model.updateDate)
但这被转换为<label for="updateDate">updateDate</label>并且值不只是显示 updateDate。如何显示值?
<label for="updateDate">updateDate</label>
尝试DisplayFor代替LabelFor
DisplayFor
LabelFor
@Html.DisplayFor(model => model.updateDate)
DisplayFor 的一个小问题。如果你从 JS 操作中加载值,你需要添加一个带有 id 的 span 来修改它的 value 。