MR, Ambiguous controller names
Reading through Phil Haack’s post implication in supporting area in ASP.NET MVC 2 remind me the time I faced the same problem using MonoRail, I believe I had post my solution in the passed but I can’t dig inside my blog entry to get it back.
So here it goes again the trick I used in to fix the problem let assume I had Admin Area & User Area and each has a HomeController I then would create controller file like this:
- Admin [ Folder ]
- AdminHomeController.cs
- User [ Folder ]
- UserHomeController.cs
Then I need to use ControllerDetails attribute to give these two controller a prefer url
// access with /admin/home/index.castle
[ControllerDetails("home", Area="admin")]
public class AdminHomeController: SmartDispatcherController { ... }
// access with /user/home/index.castle
[ControllerDetails("home", Area="user")]
public class UserHomeController: SmartDispatcherController { ... }
That work for me !
