I use asp.net (webforms flavour) for the server coding. Let's say that I stored a variable called "test" inside the Session object.
Is there a way to grab its content inside the javascript js file (I use Jquery). Currently, I use the following workaround - in my aspx.cs file I populate a hidden field, then in Jquery I grab the contents of that field.
What is the proper way to do that?
I tried to expose the session through a web method and using $ajax function to get the value on the Jquery side, but I am getting security error - "permission denied" - no additional explanation offered.
My workaround works fine, but to me it seems rather clunky. What are the common ways to achieve session access in Jquery?