hi all,
I have currently the following routes:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.gif/{*pathInfo}");
MvcRoute.MappUrl("{controller}/{action}/{ID}")
.WithDefaults(new { controller = "home", action = "index", ID = 0 })
.WithConstraints(new { controller = "..." })
.AddWithName("default", routes)
.RouteHandler = new MvcRouteHandler();
MvcRoute.MappUrl("{title}/{ID}")
.WithDefaults(new { controller = "special", action = "Index" })
.AddWithName("view", routes)
.RouteHandler = new MvcRouteHandler();
The SpecialController has a method : public ActionResult Index(int ID)
whenever i point my browser to : http://hostname/test/5 i get the following error:
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 'SpecialController'. To make a parameter optional its type should be either a reference type or a Nullable type. Parameter name: parameters Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Do you have any idea why is that? I used the mvccontrib route debugger and it seems that the route is accessible as expected