0
我已經註冊了不同的路線,和剛纔添加以下到我的收藏的頂部:MVC路徑登記
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'
如果我刪除這些路由,然後一切都很好。
路線應該是這樣'新{控制器= 「Terminals_Employees」,動作= 「UnAssignEmployee」, EMPLOYEEID = UrlParameter.Optional, datagroupId = UrlParameter.Optional' – 2013-05-08 12:53:19