ASP.NET MVC 3: Override “name” attribute with TextBoxFor

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" })

Leave a Comment