I'm working through a MVC book which uses the older version of Html.RenderAction
. So it looks like this in the book Html.RenderAction("Summary", "Cart");
I have had to convert to Html.RenderAction<CartController>(m => m.Summary(new Cart()));
.
Where Summary looks like:
public ViewResult Summary(Cart cart)
{
return View(cart);
}
I have a binding set up for Cart in the global.asax
ModelBinders.Binders.Add(typeof(Cart), new CartModelBinder());
So what is the best way do get the Binding to create the parameter cart
instance rather then me manually doing it?
I have several ideas of how to fix this, but since I'm new to MVC I'm looking to see what the accepted practice is.
Thanks