public ActionResult AddItem(int product, int quantity) { var sku = GetProduct(product); var item = new CartItem(sku, quantity); var cart = GetCurrentCart(); cart.Items.Add(item); //add all the separate action results that we want into // a SuperLoad result, mapping each one to the right selector and update type. return new SuperLoadResult( new SuperLoadAjaxContent("#cartTotal", SuperLoadCommand.Update, () => CartTotal(cart)), new SuperLoadAjaxContent("#cart", SuperLoadCommand.Append, () => CartItem(item)) /* you can also try other types of updates, like SuperLoadCommand.Prepend OR SuperLoadCommand.Custom("replaceWith") */ ); }
public ActionResult CartItem(CartItem item) { return PartialView("CartItem", item); }