protected void btnRemove_Click(object sender, EventArgs e) { if (cart.Count > 0) { if (lstCart.SelectedIndex > -1) { cart.RemoveItem(lstCart.SelectedIndex); this.DisplayCart(); } else { lblMessage.Text = "Please select the item you want to remove."; } } }