无法将类型"System.Web.HttpCookie[]"隐式转换为"System.Web
怎么解决啊?

解决方案 »

  1.   

    OdbcDataReader dr=cmd.ExecuteReader();
    if(dr.Read())
    {   
    HttpCookie cookie = new HttpCookie["qx"];
    cookie.Value=dr["qx"].ToString();

    cookie.Expires=DateTime.Now.AddDays(2);
              Response.AppendCookie(cookie);
    Response.Redirect("WebForm2.aspx");
    }
    如果我用Session,Session时间很短。执行成功后,过会再查询页面出错: 
    if(Session["qx"].ToString()=="ALL") 
    未将对象引用设置到对象的实例。 
    另外if(Session["qx"].ToString()=="ALL") 
    {Response.Write("wwwwwwwwwww");} 
    语句中为何Response.Write("wwwwwwwwwww")执行不到? 
    谢谢! 
      

  2.   

    Label3.Text=Session["qx"].ToString(); 
    Label3.Text显示ALL啊。 另外Session.TimeOut=600;可以吗?过会再查询页面还是出错: 
    if(Session["qx"].ToString()=="ALL") 
    未将对象引用设置到对象的实例。