Let\'s say I have a controller:
public BController : Controller
{
public ActionResult Foo(FooViewModel vm)
{
...
}
}
an
An update to @WWC's answer that will help the target action be able to find the view it needs.
public AController : Controller
{
public ActionResult Bar(BarViewModel vm)
{
FooViewModel fooVm = MakeFooVM(vm);
var bController = new BController();
var bControllerContext = new ControllerContext(this.ControllerContext.RequestContext, bController);
// update route so action can find the (partial)view
bControllerContext.RouteData.Values["controller"] = "B";
bController.ControllerContext = bControllerContext;
return bController.Foo(fooVm);
}
}