From e044b737a6851caebb8846a6f1c6dd20b9c3b85f Mon Sep 17 00:00:00 2001 From: Robert Haken Date: Mon, 23 Sep 2024 02:04:30 +0200 Subject: [PATCH] [Blazor] Components - loop samples - intro text removal (#33675) --- aspnetcore/blazor/components/index.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/aspnetcore/blazor/components/index.md b/aspnetcore/blazor/components/index.md index 68ec335a09..b1dec37e78 100644 --- a/aspnetcore/blazor/components/index.md +++ b/aspnetcore/blazor/components/index.md @@ -1270,8 +1270,6 @@ 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 a for loop and an index variable

- @for (int c = 1; c < 4; c++) { var ct = c; @@ -1285,8 +1283,6 @@ 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 -

Alternative approach without an index variable

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