如何使用Html.RenderAction实现ModelBinding?

| 我正在研究一本使用较旧版本的“ 0”的MVC书。因此在《ѭ1》一书中看起来像这样,我不得不转换成《ѭ2》。 摘要如下所示:
public ViewResult Summary(Cart cart)
{
    return View(cart);
}
我在global.asax中为购物车设置了绑定
ModelBinders.Binders.Add(typeof(Cart), new CartModelBinder());
那么,使Binding创建参数
cart
实例而不是由我手动执行的最佳方法是什么? 对于如何解决此问题,我有一些想法,但是由于我是MVC的新手,所以我希望了解可接受的做法。 谢谢     
已邀请:
而不是使用
HTML.RenderAction()
使用
HTML.RenderPartial()
例如:
<% Html.RenderPartial(\"Summary\", new cart(parameters)); %>
这将确保工作。     

要回复问题请先登录注册