我在我的 asp mvc 应用程序中遇到了例程问题:The resource cannot be found.
Requested URL: /Admin/Users/Update
我的操作代码是:
[HttpGet]
public ActionResult UpdateUser(int userId)
{
-some code-
return View();
}
动作链接是:
@Html.ActionLink((string)fullName, "Update", "Users", new { userId = user.Id }, null)
路线:
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Admin_default",
"Admin/{controller}/{action}/",
new { controller = "Units", action = "Units" },
new [] {"RSystem.Areas.Admin.Controllers"}
);
}
但其他动作,例如
public ActionResult Users(Role? role)
工作正常