@Html.ActionLink("Delete", "Delete", new { id = item.Id }, new { onclick = "return confirm('Are you sure you want to delete this entry?');" })
The above is pretty bad as it will allow a GET to a delete action that should rather only accept a POST. To refactor this to a better design, rather add this to your view:
1 2 3 4 5
<form asp-action="Delete" asp-route-id="@item.Id"> <a asp-action="Edit" asp-route-id="@item.Id">Edit</a> | <a asp-action="Index" asp-route-id="@item.Id" asp-controller="EntryPlatform">Platform</a> | <input type="submit" value="Delete" class="btn-link" onclick="return confirm('Are you sure you want to delete this entry?');" /> </form>