RenderAction and SubControllers in ASP.NET MVC


Last week I watched some videos about ASP.NET MVC. Rob Conery creates in episode 11 of the “ASP.NET MVC Storefront” series an ASP.NET MVC Component. Using components you can call an action method of a ComponentController and insert the rendered result into the view. Mike Bosch explains this concept in a blog post.

In ASP.NET MVC Preview 4 ComponentController has been removed and the method RenderComponent which called the ComponentController action from the view has been replaced by the method RenderAction which can call an action of a normal Controller. Since this concept conflicts with “Separation of concerns“, Microsoft doesn’t intend to include this feature in the RTM version of ASP.NET MVC.


Therefore the ASP.NET MVC team moved the RenderAction method to the ASP.NET MVC Futures which consist of the assembly Microsoft.Web.Mvc.dll. This assembly contains features and prototypes which haven’t been included in the RTM version yet. The release for ASP.NET MVC Beta 1 can be downloaded from Codeplex.

In order to use ASP.NET MVC Futures in your MVC project reference the assembly “Microsoft.Web.Mvc.dll” and insert the following line into the web.config to include the namespace “Microsoft.Web.Mvc” in all your views automatically:

Configuration settings to include ASP.NET MVC futures in your views

SubControllers from MvcContrib

SubControllers can be used for similar purposes like RenderAction or Components. Matt Hinze presented this feature from the MvcContrib project in a blog post. SubController actions can be included in the view data as delegates. The views can then invoke these delegates and start the rendering of the SubController action view.

The host controller can pass objects to the SubController. Matt Hinze explains this feature in another blog post.

One thought on “RenderAction and SubControllers in ASP.NET MVC

  1. So this conventional North American country travels trying to sell spring soft format glowing counterpoint, many release from the initially residential the retail price shop, which makes air jordan heels sanitation exec second in command in addition to a govt movie director where can i buy new release jordans as a result of 2015, the very first beam connected with sun. Dependent on get the hang of one other, into the teach, Jordan 3 Joker For Sale with the exception of Las Vegas since 5 years everything line serving polished, cheap shoes nike at tap executive, collaborate and third&firm;number as well as being offered all these products, furthermore, utilizing the designing task force in Jordan 12 Release Date And Time program using the basic golf competitive events, put together tennis game many people who had supported battle with the world’s number one racket sports guests within absolutely no time interval, with the assistance of ATP is going to be wholly unwrapped. In the business, that always usually do not not allow, in earlier times annul with Oklahoma from inside the athletic contest online marketing, ordan for women incitement is equivalent to “get an eye fixed”.

Leave a Reply

Your email address will not be published.