Ejemplo n.º 1
0
        public void LoadSanPham()
        {
            if (Request.QueryString["url"] != null)
            {
                string ulr = Request.QueryString["url"];
                Session["url"] = Request.UrlReferrer.ToString();
                DAL_KetNoi dao = new DAL_KetNoi();
                switch (ulr)
                {
                case "Adidas":
                    dtlSanPham.DataSource = dao.LoadSPTheoLoai(1);
                    dtlSanPham.DataBind();
                    Session["LoaiSP"] = "Adidas";
                    break;

                case "Nike":
                    dtlSanPham.DataSource = dao.LoadSPTheoLoai(2);
                    dtlSanPham.DataBind();
                    Session["LoaiSP"] = "Nike";
                    break;

                case "Jordan":
                    dtlSanPham.DataSource = dao.LoadSPTheoLoai(3);
                    dtlSanPham.DataBind();
                    Session["LoaiSP"] = "Jordan";
                    break;

                //case "tk":
                //    string TenSP = Request.QueryString["value"];
                //    dtlSanPham.DataSource = dao.TimKiemSanPham(TenSP);
                //    dtlSanPham.DataBind();
                default:
                    break;
                }
            }
        }