string userid = Session["User_Name"].ToString() ;
Response.Write("<script>");
Response.Write("window.parent.location.href='bbs/index.asp?userid=" + userid + "';</script>");
如果用此方法,在浏览器的地址中会出现:http://localhost/Dong_Feng/bbs/index.asp?userid=1
这样就暴露了用户名,如何消去用户名,即实现隐含传值呢?不要用加密。
请帮忙给出具体代码,提示性的。谢谢!!!

解决方案 »

  1.   

    string userid = Session["User_Name"].ToString();
    Response.Write("<form id='f1' action='bbs/index.asp' method='post'>");
    Response.Write("<input type='hidden' name='userid' value='");
    Response.Write(userid);
    Response.Write("'></form>");
    Response.Write("<script>");
    Response.Write("document.f1.submit();");
    Response.Write("</script>");
      

  2.   

    直接取SESSION 里的不就行了
      

  3.   

    同意楼上的,在http://localhost/Dong_Feng/bbs/index.asp这个页面,直接读SESSION不就行了吗
      

  4.   

    ffansky(ffansky) 你说的这种方法,我有试过,好像不行,ASP读出SESSION值为空。
      

  5.   

    刚才没看清!楼主说的是传递给asp ,不是aspx。这样session 就得不到了 ,还是用2楼的方法试试吧
      

  6.   

    具体可以如下实现:
    1)做一个隐藏的Form,把Form的方法设为post
    2)把要传的参数用 javascript 放到 hidden控件里。<form id = theForm action="http://你的地址.asp" method="post">
    <input type=hidden value="hahahaha" name ="var">
    </form><script>
    document.theForm.var.value = '你的变量';
    document.theForm.submit();
    </script>