Routes and namespaces

As I”ve said in one of my previous posts, you can have 2 controllers with the same name, but on different namespaces. The problem with this approach is that you”ll only be able to get a route by specifying its name. So, if you don”t want to use a name or if you can”t (for instance, if you”re using the HtmlHelper.ActionLink, which simply doesn”t let you specify a name), you”re out of luck.

Steve Sanderson extended the Route class so that you can indicate a namespace when trying to get a route by controller name from the route collection. It”s still a bit rough, but it should point you on the right direction.


~ by Luis Abreu on July 30, 2008.

One Response to “Routes and namespaces”

  1. Yep, a bit complicate, but all these extra coding sample will probably turn out in feature that the ASP.NET MVC team will include in the RTW of the framework.
    Btw: great blog… subscribed!!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: