How to use foreach loop in ASP.NET MVC .cshtml file?

Asked 19-Aug-2022
Updated 19-Aug-2022
Viewed 483 times

1

I want to show multiple records in a list on the page in MVC. I want to use foreach loop for it, anyone can help me how to apply it?


1 Answer


0

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