【发布时间】:2018-05-12 20:15:55
【问题描述】:
我正在尝试将产品列表存储在我存储在会话中的 List 中,但是当我添加第二个产品时,它只显示在我的查看页面中。 .....
List<ShoppingCartItem> ShoppingCartItems = new List<ShoppingCartItem>
{
new ShoppingCartItem() {Product = product.Name, Attributes = atts, Options = opts, Price = producttotalprice, Quantity = 1}
};
if (Session["Cart"] == null)
{
Session["Cart"] = ShoppingCartItems;
}
return View(Session["Cart"]);
}
任何人都可以帮我取回我存储的所有产品。
【问题讨论】:
-
添加第二个产品的代码在哪里?
标签: asp.net-mvc list session