protected void Button1_Click(object sender, EventArgs e) { Book book = (Book)Session["book"]; int quantity = 1; string userID = "1"; CartDetail c = BusinessLogic.GetCartDetails(book.BookID, userID); if (c == null) { BusinessLogic.AddCart(userID, book.BookID, quantity); } else { BusinessLogic.UpdateCart(c.CartDetailID); } if (User.Identity.Name == null) { Response.Redirect(".aspx"); } Response.Redirect("Cart.aspx"); }