Search code examples
asp.net-mvchtml-helperrazor

HtmlHelper NameFor method


Is there an Html.NameFor feature, that gets the name html attribute for a model item?

I'd like to use the following code in my Razor view:

<input type="text" value="@Model.User.Email" name="@Html.NameFor(x => x.User.Email)">

Solution

  • Yes, there is Html.NameFor method in the ASP.NET MVC Futures assembly.