erichexter / twitter.bootstrap.mvc

nuget package to make bootstrap easy with mvc4
Apache License 2.0
248 stars 134 forks source link

Add support for specifying a namespace for controllers #15

Closed serra closed 11 years ago

serra commented 11 years ago

When working with Areas , we can have two or more controllers with the same name in an mvc app, which leads to the following exception when using MapNavigationRoute:

Multiple types were found that match the controller named 'Home'. This can happen if the route that 
services this request ('') does not specify namespaces to search for a controller that matches the 
request. If this is the case, register this route by calling an overload of the 'MapRoute' method that 
takes a 'namespaces' parameter.

To specify routes, we need to be able to specify a namespace, which should be added to newRoute.DataTokens["Namespaces"]. Implemented this the same way as System.Web.Mvc.RouteCollectionExtensions.MapRoute(... string[] namespaces ...).

I noticed some commented code MapNavigationRoute<T> that wanted to do something with the namespace of the controller. Maybe we can combine this?

serra commented 11 years ago

Is this what you'd like to see? I've merged in your changes up until c1a1ffc9b153656c70ad5f0a51d55f47a025912f (child route support).

erichexter commented 11 years ago

yes that looks good.

Eric Hexter

blog | http://Hex.LosTechies.com info | http://www.linkedin.com/in/erichexter

On Mon, Nov 26, 2012 at 5:50 AM, Marijn van der Zee < notifications@github.com> wrote:

Is this what you'd like to see? I've merged in your changes up until c1a1ffchttps://github.com/erichexter/twitter.bootstrap.mvc/commit/c1a1ffc9b153656c70ad5f0a51d55f47a025912f(child route support).

— Reply to this email directly or view it on GitHubhttps://github.com/erichexter/twitter.bootstrap.mvc/pull/15#issuecomment-10712677.

erichexter commented 11 years ago

can you merge this with the upstream changes?

serra commented 11 years ago

Will do that, but it might have to wait until Monday.

serra commented 11 years ago

Is merged to head of master branch, see https://github.com/erichexter/twitter.bootstrap.mvc/network