protected void rptrCart_ItemCommand(object source, RepeaterCommandEventArgs e) { string ProductId = e.CommandArgument.ToString(); Label lblProPrice = (Label)e.Item.FindControl("lblProPrice"); TextBox txtQty = (TextBox)e.Item.FindControl("txtQty"); Label lblSize = (Label)e.Item.FindControl("lblSize"); Label lblColor = (Label)e.Item.FindControl("lblColor"); Control footer = rptrCart.Controls[rptrCart.Controls.Count - 1].Controls[0]; TextBox txtCoupon = (TextBox)footer.FindControl("txtCoupon"); string amount; amount = ValidateCoupon(txtCoupon.Text.Trim()); if (e.CommandName == "UpdateCart") { if (amount == "") // coupon code not applicable { RemoveDiscountSession(); } clsCart = new clsAddToCart(); clsCart.SetQtyAndPriceWithSizeColor(ProductId, Convert.ToDouble(txtQty.Text), Convert.ToDouble(lblProPrice.Text), lblSize.Text, lblColor.Text); //BindCart(); //setCoupoCodePanel(); } else if (e.CommandName == "Remove") { if (amount == "") // coupon code not applicable { RemoveDiscountSession(); } clsCart = new clsAddToCart(); clsCart.RemoveItem(e.Item.ItemIndex); // BindCart(); // setCoupoCodePanel(); } else if (e.CommandName == "Coupon") { if (amount != "")//coupon code applicable { Session["Discount"] = Convert.ToDouble(amount); Session["CouponCode"] = txtCoupon.Text; } else { MsgBox("Coupon not Applicable"); return; } } BindCart(); BindFinalAmt(); BindTopCartItems(); BindOrderSummary(); setCoupoCodePanel(); }