我有一个复杂类型的模型,即用户/地址/地址列表
public class User{ public List<Address> Addresses{get;set;} }@H_403_3@在我的视图中我显示了这个
<fieldset><legend>@Html.DisplayNameFor(model=>model.Addresses)</legend> <table> <tr> <th> @Html.DisplayNameFor(m => Model.Addresses.Street) </th> <th> @Html.DisplayNameFor(model => model.Addresses.City) </th> <th> @Html.DisplayNameFor(model => model.Addresses.State) </th> </tr> @foreach (var item in Model.Addresses) { <tr> <td> @Html.DisplayFor(m => item.Street) </td> <td> @Html.DisplayFor(m => item.City) </td> <td> @Html.DisplayFor(m => item.State) </td> </tr> } </table></fieldset>@H_403_3@DisplayNameFor Street / City / State不起作用.
在子对象上获取DisplayNameFor的正确方法是什么?
TIA
Ĵ