Possible Duplicate:
ASP.NET MVC - Catch All Route And Default Route
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
routes.MapRoute(
name: "CatchAll",
url: "{id}",
defaults: new { controller = "Home", action = "CatchAll", id = UrlParameter.Optional }
);
Is there an easy way of implemeting the following routing pattern. Basically i would like the catch all to kick in if the controller does not exist. The pages are dynamically populated for these pages if they exist in the database. Other wise i'll throw an error. I do NOT want a route that starts with any thing else. for example
routes.MapRoute(
name: "CatchAll",
url: "Caught/{id}",
defaults: new { controller = "Home", action = "CatchAll", id = UrlParameter.Optional }
);
I can get it so that each work individually but to get them to work at the same time is proving a little difficult. I'm guessing i will need to overload something somewhere. There must be a guru out there who knows the answer! :D