我正在使用以下代码,当您单击图像时我想调用编辑操作 目前我有错误
<a href="@Url.Action(" ", "Edit", new { id = item.UserId })"><img src="../../imges/pen.jpg"></a>
这是错误
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Edit/ /f
当我使用以下默认代码时,我应该如何从图标调用编辑操作?
@Html.ActionLink("Edit", "Edit", new { id = item.UserId }, new { @class = "btn btn-mini btn-info icon-edit bigger-120" }) |
最佳答案
试试这个:
<a href="@Url.Action("Edit", new { id = item.UserId })">
<img src="../../imges/pen.jpg">
</a>
根据MSDN documentation @Url.Action()
的第一个参数是 actionName
,第二个是附加参数。
关于jquery - 通过图标调用操作不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23974159/