protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["CustomerId"] == null) { Response.Redirect("~/LogIn.aspx"); } if (Request.QueryString["ProductId"] != null) { int productId = int.Parse(Request.QueryString["ProductId"]); cartItemService.Add(Convert.ToInt32(Session["CustomerId"]), productId, 1); } Label2.Text = "温馨提示:更改购买数量后,请单击'重新计算'按钮进行更新!"; Bind(); } }