I tried this way, but the button does not appear even though the items are larger than 0.
How can I do this?
Try add
else { btnRemoveToCart.Visible = true; }
It's not enough to set it to false if you don't want it to show. You also need to set it to true when you want to see it again. But you can write one line that does both:
false
true
btnRemoveToCart.Visible = (lbxCart.Items.Count > 0);
Now we also no longer need the if() check.
if()
Copyright © 2021 Jogjafile Inc.
Try add