开发者

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

开发者 https://www.devze.com 2023-02-23 12:06 出处:网络
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 with minimum e

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 with minimum extra fluff.

Is it possible/how can I access the session object from within a static method in a static class?


HttpContext.Current.Session

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

0

精彩评论

暂无评论...
验证码 换一张
取 消