protected void lbtn_AddToCart_Click(object sender, EventArgs e) { if (Session["id"] == null) { Response.Redirect("~/Default.aspx?login=false"); } else { Label lb = (Label)((LinkButton)sender).FindControl("lbl_Prod_id"); String prod_id = lb.Text; String user_id = Session["id"].ToString(); SalesHandler sales = new SalesHandler(); Boolean flag=sales.addToCart(user_id, prod_id); if (flag == false) lbl_NoStock.Visible = true; else lbl_AddedToCart.Visible = true; } }