MvcContrib latest release now with SubController support
One of the items that many people I know have requested are subcontrollers. Most non-trivial web applications require many things happening on a single screen. Even if it's only the current shopping cart displayed on multiple screens, the MVC Framework needs a mechanism of screen decomposition so that web applications can scale with complexity. WebForms has the Control model where markup and logic live together and can be composed easily.
With the MVC Framework CTP 5, a single action method has to make decisions for the entire screen. There are ActionFilters that can do some logic, but those are attributes, and attributes are not conducive to logic decomposition. Furthermore, ActionFilters do not work with partial views.
RenderPartial also doesn't do the job because the main view still has to know the partials.
If you haven't looked at MvcContrib's SubController support, have a look at the latest release and check out the samples. The samples show many uses for SubControllers for GETs, POSTs, and unlimited nesting of SubControllers. Each SubController has its own view, and it uses Action methods with all the same built-in dynamicism as regular controllers. In Fact, SubController inherits from Controller, so a SubController IS a Controller.
We (Headspring) are using MvcContrib SubControllers in real projects, and they are paying strong dividends.
I'm still hoping SubControllers will make it into the ASP.NET MVC Framework, but if they don't, I'm happy using this implementation.
You can follow MvcContrib on twitter. See what Matt Hinze has said about his experience with SubControllers.

Comments
Aaron Jensen said on 10.06.2008 at 11:19 AM
Maybe I'm missing something, but it appears that what you call SubControllers are not at all Controllers. Controllers have multiple actions. The SubControllers just have one named action that may as well be an Initialize method.
These appear to be analogous to MonoRail Components. Components are more explicitly *not* controllers. I think this is an important distinction. Calling them subcontrollers simply confuses people because they're *not* controllers.
Unless I'm missing something...
Jeffrey Palermo said on 10.06.2008 at 12:57 PM
@Aaron,
The named action is a convention. They support unlimited, distinct actions, just like regular Controllers. If you have a specific action name that you'd like invoked, you can certainly set that in the parent controller. I did not add that as a specific property, but it may be a good idea.
If you look at the source, you'll see "action" being set in the ControllerContext to the default one (by convention).
Because SubControllers can be used in many different pages (and Urls), the action can't be derived from the url but instead should be dictated by the parent controller.
Thanks for the observation. The explicit Action property might be a good thing to add.
tasarım said on 10.07.2008 at 3:39 PM
It really is a great contribution to the community. I also hope it will be implemented in ASP.NET MVC.
Craig Bowes said on 10.16.2008 at 11:27 AM
Maybe i'm missing something too. I'm using MVC Preview 5 and it appears you can nest controllers in a view using RenderAction:
blog.wekeroad.com/.../asp-net-mvc-pre
This lets you reuse ANY controller action on a View.
shiju varghese said on 11.08.2008 at 11:39 PM
Check the steve sanderson's solution for partial requests http://blog.codeville.net/2008/10/14/partial-requests-in-aspnet-mvc/.
It is a nice and cleaner solution.
Mohammed - Familienrecht Rechtsanwalt Stuttgart said on 2.23.2009 at 6:36 AM
hello! you know, as a common ordinary user i've heard about subcontrollers, but i haven't heard anything about MvcContrib's SubController support... I think now MVC Framework will become more popular than before as this is really a nice addition!
Liam said on 2.23.2009 at 6:45 AM
I think it's awesome! I was hoping someone would make my dreams come true. I'm really greatful for this prompt! It has opend one more useful possibility to me! I hope it will somehow change for the better the work of my poor blog which is the only sweets of my life
Alfie - Fishing said on 2.23.2009 at 3:25 PM
You got quite a lot of (good) content there. I'd say it's one of those sites where it would make a lot of sense to use future-proof markup. A lot of smaller businesses seem to be very happy with their little custom applications. They will most likely stick around and the demand for this kind of information won't drop to zero anytime soon. With virtualization at hand you can basically keep them up and running forever.
Isabella - Hotels De Amsterdam said on 3.12.2009 at 9:43 AM
I try to work with MvcContrib, but I have many problems still...Really I do not know how personally I can apply these SubControllers or whatever they are, some people claim there that they are really not the ones, but still I'm glad that you are continuing to make such usefull for many people discoveries, hope your potential will never be exhausted, and wait for the next post with eager!
movers said on 3.18.2009 at 7:03 PM
i try to look at it 1 more time and it seems to me a s awonderful thing to do.
great optionj, great moves.