session是运行在服务端的,因此无法在客户端取出来,你要在客户端取值的话,用cookie

解决方案 »

  1.   

    把值赋给一个public全局变量tempstr,然后在客户端接收
    <%=tempstr%>
      

  2.   

    取得
    var tmpStr="<%=Session("SessionName")%>"
    修改,以post或get提交后
    Session("SessionName")=Request["tmpStr"]
      

  3.   

    请各位看看这样写对不对:在Formload事件中这样写:        Session("SessionName") = "hello"
            Response.Write("<Script language=javaScript>")
            Response.Write("var tmpStr='<%=Session('SessionName')%>'")
            Response.Write("</script>")
            Response.Write(Session("SessionName"))
     
    不过好像Javascript出错了!