ASP.NET - Access Session from static method/static class?

前端 未结 1 1645
长情又很酷
长情又很酷 2021-02-03 18:17

I would like to access the session object without passing it to my static helper function.

This is so I can save and load things from the session object automatically w

1条回答
  •  抹茶落季
    2021-02-03 18:44

    HttpContext.Current.Session
    

    MSDN: http://msdn.microsoft.com/en-us/library/system.web.httpcontext.current(v=vs.110).aspx

    0 讨论(0)
提交回复
热议问题