不用
Session["yoursessionname"]

解决方案 »

  1.   

    using System.Web.SessionState;
    你可以把你的Page作为参数传入到类中
      

  2.   

    using System;
    using System.Web;
    using System.Web.Security;HttpContext.Current.Session[CART_KEY]
      

  3.   

    using System.Web;HttpContext.Current.Session["Name"]="hahah";
      

  4.   

    楼上的,认识一下吧,“hah”,我也老用`!~!呵呵
      

  5.   

    设置Session["id"];
    取string id=Session["id"];