I’m working on an ASP.NET MVC application. The app is broken up into a dozen ‘sections’, each of which has multiple tasks the user can perform. Many of these subtasks deserve their own controller, I don’t like ‘kitchen sink’ controllers.
I want to organize my controllers by adding a namespace hierarchy:
Foo.SubFoo1.List
Foo.SubFoo2.List
etc.
I figured out how to create the routing rules, I just don’t know how to wire up the correct view. The MVC framework doesn’t factor my controller’s parent namespace into the algorithm when it looks for the view:
Foo.SubFoo1.List ==> MVC looks for a view Views\SubFoo1\List.aspx, but I want it to look for Views\Foo\SubFoo1\List.aspx
Suggestions?
The literal answer to your question is ‘override the default ViewEngine,’ but it sounds like you’re really looking for ‘areas.’