for
foreach
@inherits Custom.Hybrid.RazorTyped @{ var pets = new string[] { "dog", "cat", "mouse"}; } <ul> @foreach (var pet in pets) { <li>@pet</li> } </ul>
@inherits Custom.Hybrid.RazorTyped @{ var pets = new string[] { "dog", "cat", "mouse"}; } <ul> @for(var i = 0; i < pets.Length; i++) { <li>@pets[i]</li> } </ul>
@inherits Custom.Hybrid.RazorTyped @{ var pets = new string[] { "dog", "cat", "mouse"}; var owners = new string[] { "Daniel", "John", "Markus"}; } <ul> @for(var i = 0; i < pets.Length; i++) { <li>@pets[i] - owned by @owners[i]</li> } </ul>