Razor page foreach code example Example: cshtml foreach @foreach (var item in Model.Foos) { <div>@item.Bar</div> }