更新时间:2023-10-07 12:41:34
Rob,其实还有更简单的方法.使用 Name 代替 name:
Rob, actually there is a much simpler way. Instead of name, use Name:
@Html.TextBoxFor(x => x.Data, new { Name = Model.Key + "_Data", id = Model.Key + "_Data" })
ASP.NET MVC 3:覆盖“名称"带有 TextBoxFor 的属性