Asp.net-Mvc
HtmlHelper NameFor 方法
是否有一個
Html.NameFor功能可以獲取name模型項的 html 屬性?我想在我的 Razor 視圖中使用以下程式碼:
<input type="text" value="@Model.User.Email" name="@Html.NameFor(x => x.User.Email)">
是的,ASP.NET MVC Futures 程序集中有
Html.NameFor方法。
Html.NameFor現在包含在 MVC 4 中。