MyCart.aspx.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class MyCart : System.Web.UI.Page
{
    //新增商品ID
    string AddProID;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["sex"]== null || Session["sex"].ToString() == "")
        {
            Response.Write("<script language='javascript'>alert('请先登录!');</script>");
            Response.Write("<script language='javascript'>window.history.go(-1);</script>");
        }
        else
        {
            //获取productinfo.aspx页面各个表单的值
            try
            {
                AddProID = Request.QueryString["id"].ToString();
            }
            catch
            {
                AddProID = "";
            }
            if (!IsPostBack)
            {
                if (Session["dtProducts"] == null)
                {
                    Session["dtProducts"] = createProductDT();
                }
                if (AddProID == "" || AddProID == null)         //检测是否为直接查看购物车.    
                {
                    BindShopBasket();
                }
                else
                {
                    populateProducts();
                    BindShopBasket();
                }
            }
        }

    }

    //绑定购物车
    private void BindShopBasket()
    {
        gvProducts.DataSource = Session["dtProducts"];
        this.gvProducts.DataKeyNames = new string[] { "id" };
后面还有 171 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。