【发布时间】:2021-12-02 20:15:41
【问题描述】:
事情是这样的:
我有两页,
- 一个带有供应商列表的人
- 如果我点击其中一个供应商,我应该会进入第二页,其中包含所选供应商的所有用户。
这是我的代码,
页面选择供应商:
var link = '@Url.Action("UserManagement", "Home", new { GB = @ViewBag.GB, id = "code" })';
link = link.replace("code", listSuppliers[i].Item2);
suppliersTable.row.add([
"<form action='" + link + "'><button type='submit' class='btn btn-primary'>" + listSuppliers[i].Item3 + " account(s)</button></form>" //Number of accounts, clickable to see all accounts
]).draw(false);
控制器:
[HttpPost]
public ActionResult UserManagement(string GB, string id)
{...
return View();
}
问题是当我点击我的供应商时,页面 UserManagement 显示:“如果问题仍然存在,此页面将无法正常工作,请联系网站所有者 HTTP 错误 405"
我真的不明白,谁能帮帮我?
【问题讨论】:
标签: c# asp.net-mvc http-post asp.net-core-3.1 http-status-code-405