本帖最后由 teresa_tanxiaoguang 于 2009-10-16 10:32:10 编辑

解决方案 »

  1.   

    事实上在main.aspx.cs使用response.write(session["username"].tostring())已经得到了session,但是由于你页面显示的关系导致你并没有看到输出的username
    你可以f9调试进行验证,或者使用Response.Write("<script language=javascript>alert('" + session["username"].tostring()+ "');</script>"); 验证。
      

  2.   

    有的,你不要用response.write(session["username"].tostring())
    你在页面打开时
    Response.Write("<script>alert('+session["username"].tostring()+')</script>")
      

  3.   


    yfqvip你好!
    我尝试用了你的方法进行调试,但是页面没有得到响应,没有弹出对话框,
      

  4.   

    flyerwing 你好!
    我试过
    label_user.Text = "当前用户:" + Session["UserName"].ToString();
    没有显示。
      

  5.   

    cnhuangjin 你好!,我在页面load里面加入了Response.Write(" <script language=javascript>alert('" + Session["username"].ToString()+ "'); </script>");没有反应。