cshtml foreach display
snippet in html

cshtml foreach

user7698

@foreach (var item in Model.Foos)
{
    <div>@item.Bar</div>
}

cshtml foreach display

user7681

@for (int i=0; i < Model.allemp.Count;i++)
{
<tr>

    <td>@Html.Label(Model.allemp[i])</td>

    <td>@Html.Label(Model.alldept[i])</td>


</tr>

}