【发布时间】:2021-09-11 05:49:29
【问题描述】:
所以我正在尝试制作一个显示客户数据的 Blazor 应用程序。当显示所有客户时,我希望能够导航到单个客户。我无法完成这项工作。主要概念在下面的代码中,我也有预期的模型。
@for(int i = 0; i < customers.Length-1; i++)
{
<tr>
<td>@customer.Id</td>
<td>@customer.CustomerId</td>
<td>@customer.LastName</td>
<td>@customer.FirstName</td>
<td>@customer.Name1056Form</td>
<td>@customer.TrapezeClientId</td>
<td>@customer.CustomerNote</td>
<td @onclick="NavToCustomer(i)"> Details</td>
</tr>
private void NavToCustomer(int i)
{
int Id = i;
navigation.NavigateTo("/Customer/" + Id);
}
}
【问题讨论】:
-
I am having trouble making this work.- 你能详细说明一下吗?什么不工作? -
您好,我收到“无法从 'void' 转换为 'Microsfot.AspNetCore.Components.EventCallBack'”错误。
标签: c# loops navigation blazor