ASP.NET MVC controllers with identical names

Posted by Anton Gogolev on Stack Overflow See other posts from Stack Overflow or by Anton Gogolev
Published on 2010-03-12T13:09:23Z Indexed on 2010/03/12 13:17 UTC
Read the original article Hit count: 278

Filed under:
|

Hi!

Here's what I'm trying to do. I have an ASP.NET MVC web application, where I'd like to have a separate "admin" area (accessible via http://example.com/admin) and a regular area, available for all users.

In both these parts of the site I have a /blogs section, but when accessing http://example.com/admin/blogs I want to be presented with admin interface for blogs, whereas usual http://example.com/blogs should just list all blogs.

And the problem itself is: how do I get ASP.NET MVC to instantiate appropriate controllers, provided that there are two BlogsControllers: one in Site.Admin namespace, and the other is in Site.Sitefront namespace?

Granted, I could rename admin controller to BlogsAdminController, but I'd like to keep the names as they already are.

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about controller