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
If you haven't changed thread, you can use HttpContext.Current.Session, as indicated by jwwishart.
HttpContext.Current returns the context associated with the thread. Obviously this means you can't use it if you've started a new thread, for example. You may also need to consider thread agility - ASP.NET requests don't always execute on the same thread for the whole of the request. I believe that the context is propagated appropriately, but it's something to bear in mind.