Search code examples
c#frontendcomponentsblazorbackend

How can I pass List from child component to parent component in blazor?


I started learning Blazor technology recently.

I just want to pass a simple array/arrayList to a parent component from a child component. Here is my code:

Part 1

Part 2

Visual Studio didn't find the error while compiling.

The problem is, when I send an array to a parent, it returns null. Please help me.


Solution

  • change the below code:

    <ChildComponent Data="TakeData" ...
    

    your code removes EventCallback return value