我目前在仪表板上的按钮上使用Url.Action,因此我会保持一致的UI。
<input type="submit" value="Delete" onclick="location.href='@Url.Action("Action","Controller", new {refNumber = item.RefNumber, null}'"/>
@Html.ActionLink("Action","Controller", new {refNumber = item.RefNumber}, new {onclick="return confirm('Are you sure?');"})
答案 0 :(得分:0)
尝试一下...
<a href="@Url.Action("Action","Controller", new {refNumber = item.RefNumber, null})" onclick="return confirm('are you sure?');">Delete</a>
如评论中所述,我强烈建议您将操作更改为POST。可以阅读有关here的更多信息。