How can I get the value of a session variable inside a static method?

前端 未结 4 949
夕颜
夕颜 2020-11-30 02:50

I am using ASP.NET page methods with jQuery.... How do I get the value of a session variable inside a static method in C#?

protected void Page_Load(object se         


        
4条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 03:27

    Try this:

    HttpContext.Current.Session["UserName"].ToString();
    

提交回复
热议问题