I had an ASP.Net MVC application with routing configuration rules including this one:
routes.MapRoute(
"rule1",
"{controller}/{action}/{cid}/{language}/{itemID}/{uid}",
new { controller = "Home", action = "action1" }
, new[] { "MVCApp.Controllers" }
);
I just added new action with same number of parameter and my routing configuration changed like this (rule2 added):
routes.MapRoute(
"rule2",
"{controller}/{action}/{cid}/{language}/{phoneNumber}/{uid}",
new { controller = "Home", action = "action2" }
, new[] { "MVCApp.Controllers" }
);
routes.MapRoute(
"rule1",
"{controller}/{action}/{cid}/{language}/{itemID}/{uid}",
new { controller = "Home", action = "action1" }
, new[] { "MVCApp.Controllers" }
);
Now when I call http://localhost:51650/Home/action2/1/en/1/1
it does not route to action1
and throws exceptionThe parameters dictionary contains a null entry for parameter 'itemID' of non-nullable type 'System.Int64' for method 'System.Web.Mvc.JsonResult action1(System.String, Int32, Int64, Int64)
.