I’ve created a custom Route and registered it in Global.asax like this:
routes.Add(
null,
new SeoRoute(
"foo/{id}/{title}",
new { controller = "Foo", action = "Details" }
));
Since I’m using Areas in my application, I have to set Namespaces for each Route.
With regular routes, I do it like this:
routes.MapRoute(
null,
"foo",
new { controller = "Foo", action = "Index" },
new string[] { "Boo.Web.Controllers" }
);
But how can I set namespaces for custom routes?
Any help would be greatly appreciated!
I used
ILSpytoo see howMapRouteworks.I didn’t set
DataTokensvalue. Here’s the solution:Route class:
Global.asax: