very simple question but I couldn\'t find an answer for this:
I have the default {controller}/{action}/{id}
pattern in my global.asax.
I ne
I would suggest a separate route with a constraint that the id either can't match one of your controllers or must match one of the ids in the database. List it before the default route so it matches first, if the qualifications are met.
Example using a simple regex for a fixed constraint, though you'd probably want to create a custom constraint deriving from IRouteConstraint that limits the values dynamically.
routes.MapRoute(
"Brands",
"{id}",
new { controller = "brand", action = "detail" },
new { id = "^(Microsoft)|(Apple)$" }
);
You might want to look at http://stephenwalther.com/blog/archive/2008/08/07/asp-net-mvc-tip-30-create-custom-route-constraints.aspx for more ideas.