I know that the first route will catch most of the paths. However, this will catch also /Product/Edit/blablabla (i'm using ASP.NET Routing Debugger):
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = @"\d{1,}" }
);
routes.MapRoute(
"Catch All",
"{*path}",
new { controller = "Error", action = "NotFound" }
);
}
But this is wrong! Why? If not an integer of min 1 of length, the first route should not match. I need also to handle not found coutroller and action... any ideas?
Many thanks!