我有一个Html辅助方法,在我的控制器上调用Delete方法.
public static MvcHtmlString DeleteEmployeeOtherLeave(this HtmlHelper html, string linkText, Leave _leave)
{
return html.RouteLink(linkText, "Default",
new { _employeeOtherLeaveId = _leave.LeaveId, action = "Delete" },
new { onclick = "$.post(this.href); return false;" });
}
Run Code Online (Sandbox Code Playgroud)
在我的控制器上我有;
[AcceptVerbs(HttpVerbs.Delete)]
public ActionResult Delete(int _employeeOtherLeaveId)
{
EmployeeOtherLeaf.Delete(_employeeOtherLeaveId);
return RedirectToAction("Payroll");
}
Run Code Online (Sandbox Code Playgroud)
但我收到此运行时错误消息;
System.Web.HttpException: A public action method 'Delete' was not found on controller
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3240 次 |
| 最近记录: |