protected void gvCart_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "RemoveItem") { CartHandler.RemoveItemFromCart(HttpContext.Current.User.Identity.Name, e.CommandArgument.ToString()); gvCart.DataSource = CartHandler.GetCartByUser(HttpContext.Current.User.Identity.Name); gvCart.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { gvCart.DataSource = CartHandler.GetCartByUser(HttpContext.Current.User.Identity.Name); gvCart.DataBind(); LbCount.Text = BusinessLayer.CartHandler.GetCartItemCount(HttpContext.Current.User.Identity.Name).ToString(); } }