You can use a lambda expression to pass multiple arguments to an onclick event.
@for(var i=0; i<5; i++) {
var index = i;
<button @onclick="@(e => click(index, 5 * index))">Button @i</button>
}
@code {
private void click(int a, int b) {
Console.WriteLine(a + b);
}
}
Share with