Request URL:http://localhost:51536/Employee/AddUpdateEmployee/2
Route Config
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 }
);
}
Controller Action Method
[ActionName("AddUpdateEmployee"), HttpGet]
public ActionResult AddUpdate(Int64 EmployeeID)
{
var data = (new EmployeeDb()).GetEmployee(EmployeeID);
return View("~/Views/Employee/_AddUpdateView.cshtml", data);
}
When I check the url in browser, i get this error: The parameters dictionary contains a null entry for parameter 'EmployeeID'