Reputation: 171559
I know that within a view I can render an action from the same controller using Html.RenderPartial. However, I need to render the output from an action under a different controller. What is the best way to do this? I would prefer to do this directly within the view, rather than doing it in the controller and saving the output to a ViewData variable.
Upvotes: 2
Views: 2230
Reputation: 32698
The best thing to do is use Html.RenderAction
which needs a references to the 'Futures' assembly Microsoft.Web.Mvc
which there's a question about how to get it.
You will also need to add the namespace in your web.config in order to user it in your view:
<add namespace="Microsoft.Web.Mvc"/>
Upvotes: 1
Reputation: 1717
I would look at Steve Sanderson's implementation of "Partial Requests" found here
Upvotes: 0