Hi,
Following is a working code for displaying records in view
@using MvcWcf.ServiceReference1
@model IEnumerable<WcfService.MyAddress>
<style type="text/css">
table,tr,td{border:1px solid black;border-collapse:collapse;}
</style>
<table>
<tr>
<td>@Html.DisplayNameFor(model => model.Address1)</td><td>@Html.DisplayNameFor(model => model.City)</td>
</tr>
@foreach (var item in Model)
{
<tr><td>@Html.DisplayFor(modelItem => item.Address1)</td><td>@Html.DisplayFor(modelItem => item.City)</td>
</tr>
}
</table>
in the above code i wrote table header name and fieldnames manually.because i know i the field names.
how to write the table header name and field names automatically using reflection
regards
Baiju