10
Questa tabella popola correttamente con @device.DeviceId
ma non passa all'azione del controller.asp-route-id non passa il valore del parametro
<table border="1" cellpadding="10">
@foreach (var device in @Model.Devices)
{
<tr>
<td>@device.DeviceId</td>
<td>@device.DeviceName</td>
<td>
<a asp-action="DeleteDevice"
asp-controller="Device"
asp-route-id="@device.DeviceId" asp->
Delete
</a>
</td>
</tr>
}
</table>
La firma azione del controller è
public async Task<IActionResult> DeleteDevice(int deviceId)
L'azione è chiamata ma deviceId
= 0.
Come faccio a garantire @device.DeviceId
sia correttamente passata all'azione?
Grazie @Jamie Dunstan – Vague