我注册了各种路线,并且刚刚将以下内容添加到我的收藏顶部:
routes.MapRoute("EmployeesUnassign", "Terminals_Employees/UnAssignEmployee/{employeeId}/{datagroupId}", new { controller = "Terminals_Employees", action = "UnAssignEmployee" });
routes.MapRoute("Employees", "Terminals_Employees/{id}", new { controller = "Terminals_Employees", action = "Index" });
如果我尝试去/Terminals_Employees/UnAssignEmployee/1/2
我收到以下错误:
The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Index(Int32)' in 'Terminals_Employees.Controllers.Terminals_Employees'
如果我删除这些路线,那么一切都很好。