string var="admin";
Response.write("<script language=jscript>window.open('aa.aspx?id="+var+"')</script>")

解决方案 »

  1.   

    我好像理解错了,sorry
    Session在一段时间里是有效的(当然你可以设置失效时间),不存在你打开新的窗口,它的值就为null,不知道你是怎么取的
      

  2.   

    对不起,各位,我想你们是理解错啦
    我是想在一个窗口中点击打开一个指令大小的窗口,并且这个小窗口的值来中前一个窗口的SESSION
    我是想在弹出小窗口中使用SESSION
    eg:
    aaa.aspx:
    Session.Add("lhjid1",TextBox1.Text);
    Response.Write("<script language=jscript>window.open('viewmessage.aspx', 'content', 'width=532,height=279,left=10,top=10,location=no,toolbar=no,status=no,resizable=no,scrollbars=no,menubar=no');</script>");
    viewmessage.aspx:
    sqlstr="select * from message where kk='"+Session["lhjid1"]+"';
    可是在viewmessage.aspx中传过来SESSION中的值为NULL
    我怎样才能获得它的值呢?只用WINDOW。OPEN方法获得。。请高手指教。
      

  3.   

    不需要用Sessioneg:aaa.aspx:
    //Session.Add("lhjid1",TextBox1.Text);
    string str = TextBox1.Text;
    Response.Write("
        <script language=jscript>
         window.open('viewmessage.aspx?str="+ str +  //注意这里
         "', 'content', 'width=532,height=279,left=10,top=10,location=no,toolbar=no,status=no,resizable=no,scrollbars=no,menubar=no');</script>");viewmessage.aspx:
    //sqlstr="select * from message where kk='"+Session["lhjid1"]+"';
    sqlstr = "SELECT * FROM message WHERE kk = '" +
             Request.QueryString["str"]+ "'";
      

  4.   

    neodotnet(Neo.NET) 谢谢指点继续加油!!!
      

  5.   

    如果要传多个值怎么办可以这样吗?
    window.open('viewmessage.aspx?str="+ str+"&&str1="+str1+"', 'content', 'width=532,height=279,left=10,top=10,location=no,toolbar=no,status=no,resizable=no,scrollbars=no,menubar=no');</script>");