Link to home
Start Free TrialLog in
Avatar of JElster
JElsterFlag for United States of America

asked on

How to set a session variable in JavaScript

Hi..
How can I set a Session variable in JS?

   
I have code that get the 'value' variable

But when I try and set the session to it -   I get 'value';


                    <%Session["FILTER_EXPRESSION"] = "+ value +";%>

What is the proper way to set the session variable to the actual value?  I'm using ASP.Net and C#

thx
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JElster

ASKER

Don't understand how to do it......
you can't do this using ONLY javascript
you need help of the server
the TUTORIAL/SAMPLE codes in the link, show you how to call this server code using PageMethods

just replace "foo", “SessionKey” by "FILTER_EXPRESSION"
Avatar of JElster

ASKER

sorry still don't get it..  tried converting to C# get pagemethods undefined
Avatar of JElster

ASKER

nevermind got it