Wednesday, 21 February 2018

Data Render Using Razor

Display Student Record on cshtml page in table using Razor


@model IEnumerable<Britanic_MIS.Models.InvoiceModel>
<table >
        <thead>
            <tr><th>Roll</th><th>Name</th><th>City</th></tr>
        </thead>
        <tbody >
                 
                @foreach (var item in Model)
                {

                <tr>
                    <td>
                        @Html.DisplayFor(modelitem => item.Roll)
                    </td>
                    <td class="center">
                        @Html.DisplayFor(modelitem => item.Name)
                    </td>
                    <td class="center">
                        @Html.DisplayFor(modelItem => item.City)
                    </td>
                 
                </tr>
                }

        </tbody>

</table>

No comments:

Post a Comment