0
請求URL無效項:http://localhost:51536/Employee/AddUpdateEmployee/2參數字典包含參數 '僱員'
路由配置
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
控制器的操作方法
[ActionName("AddUpdateEmployee"), HttpGet]
public ActionResult AddUpdate(Int64 EmployeeID)
{
var data = (new EmployeeDb()).GetEmployee(EmployeeID);
return View("~/Views/Employee/_AddUpdateView.cshtml", data);
}
當我檢查在瀏覽器中的URL,我得到這個錯誤:該p arameters詞典共包含參數無效項「僱員」