protected void ToggleProductButton_Click(object sender, EventArgs e) { ProductItem product = Session["Product"] as ProductItem; if (product.productIsActive) { ToggleProduct.CssClass = "btn btn-dark"; ToggleProduct.Text = "Inactive"; product.productIsActive = false; } else { ToggleProduct.CssClass = "btn btn-dark"; ToggleProduct.Text = "Active"; product.productIsActive = true; } Session["Product"] = product; ProductItem.toggleProductActivity(product.productVendorUID); }