I've got a problem with ASP.NET mvc stongly typed helpers.
Here is example of wrong behavior:
<% foreach (var item in Model) { %>
<开发者_C百科;%: Html.TextboxFor(m => item.Name) %>
<% } %>
will generate following inputs: <input name="item.Name".....
As you see generated name is wrong, because of wrong algorithm of extracting property name from lambda.
The only way to avoid this bug is to create PartialView and pass item as its context.
May be somebody knows other solutions?
Regards, Alexey Zakharov.
Why just not <%= Html.TextboxFor(item.Name) %> ?
精彩评论