diff --git a/aspnetcore/blazor/components/index.md b/aspnetcore/blazor/components/index.md index cf49923f5d..52be13b3f5 100644 --- a/aspnetcore/blazor/components/index.md +++ b/aspnetcore/blazor/components/index.md @@ -1268,7 +1268,7 @@ Consider the following `RenderFragmentChild2` component that has both a componen When rendering the `RenderFragmentChild2` component in a parent component, use a local index variable (`ct` in the following example) instead of the loop variable (`c`) when assigning the component parameter value and providing the child component's content: ```razor -

Three children with an index variable

+

Three children with a for loop and an index variable

@for (int c = 1; c < 4; c++) { @@ -1283,7 +1283,7 @@ When rendering the `RenderFragmentChild2` component in a parent component, use a Alternatively, use a [`foreach`](/dotnet/csharp/language-reference/keywords/foreach-in) loop with instead of a [`for`](/dotnet/csharp/language-reference/keywords/for) loop: ```razor -

Second example of three children with an index variable

+

Alternative approach without an index variable

@foreach (var c in Enumerable.Range(1, 3)) {