protected void btnPlus_Click(object sender, EventArgs e) { LinkButton btn = (LinkButton)sender; GridViewRow row = (GridViewRow)btn.NamingContainer; int qty = items[row.RowIndex].Quantity + 1; if (qty > BusinessLogic.GetQty(BusinessLogic.GetBookID(items[row.RowIndex].Isbn))) { pnlError.Visible = true; } else { items[row.RowIndex].Quantity += 1; Session["cartItem"] = items; Response.Redirect("~/Cart"); } }