0

I have a page, product.aspx. Inside this page I have a label that shows the count of products added to basket. I also have viewcart.aspx page to show my cart item and edit or delete product.

Everything is well but when I delete a product from viewcart.aspx, I want to decrement the label value on product.aspx. How can I do that?

I use this jQuery to show viewcart.aspx on modal popup: http://deseloper.org/examples/simple-modal-redux/

also I've tried to use

Label lbl = (Label)this.PreviousPage.FindControl("countlbl");

How can I solve this problem?

Ken Pespisa
  • 21,989
  • 3
  • 55
  • 63
hesam salehnamadi
  • 199
  • 1
  • 1
  • 16

1 Answers1

0

In the viewcart.aspx page, you could add some jQuery to fire when it closes (i.e. on the onUnload event):

$(window).unload(function() {
  window.opener.$("#product_count_label").html("new count of products");
});
Ken Pespisa
  • 21,989
  • 3
  • 55
  • 63