我有一个model
:
public class TestModel {
[Display(Name = "Date")]
public DateTime Date { get; set; }
}
在页面中使用Html.LabelFor
辅助方法Test.cshtml
@Html.LabelFor(m => m.Date )
并将此页面与 2 个 MVC 操作方法一起使用:Create
和Update
. 例子:
public virtual ViewResult Create() {
return View("Test");
}
public virtual ViewResult Update() {
return View("Test");
}
我想显示@Html.LabelFor(m => m.Date )
页面Create
:“日期”和Update
页面:“更新日期”。我知道MVC3的正常方式是否不能做到这一点。我希望您的理想可以编辑Html.LabelFor
hepler 方法或任何将数据绑定到Html.LabelFor
控制器上的操作方法的方法