//建立页面 void BuildPage() { HttpCookie cookie = HttpContext.Current.Request.Cookies["find"]; //将cookie转化为字典 Dictionary <string, string> dict = new Dictionary <string, string>(); if (cookie.Value != "") { foreach (string key in cookie.Values) { dict.Add(key, cookie[key]); } } Clothes clothes = new Clothes(); DataTable data = clothes.ReadAll(dict); BuildGridView(data); }