Routes and namespaces

Published Wed, Jul 30 2008 23:15

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.

Filed under: ,

Comments

# Simone said on Thursday, July 31, 2008 2:43 AM

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 Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above:  

Search

This Blog

Tags

Community

Archives

Syndication

Email Notifications

News




  • View Luis Abreu's profile on LinkedIn


    Follow me at Twitter

    My books

    Silverlight 4.0: Curso Completo

    ASP.NET 4.0: Curso Completo

    Portuguese LINQ book cover

    Portuguese ASP.NET 3.5 book cover

    Portuguese ASP.NET AJAX book cover

    Portuguese ASP.NET AJAX book cover