Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to set a session variable in JavaScript

Posted on 2013-06-07
5
Medium Priority
?
758 Views
Last Modified: 2013-06-07
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
0
Comment
Question by:JElster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 1600 total points
ID: 39229180
0
 
LVL 1

Author Comment

by:JElster
ID: 39229211
Don't understand how to do it......
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39229244
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"
0
 
LVL 1

Author Comment

by:JElster
ID: 39230129
sorry still don't get it..  tried converting to C# get pagemethods undefined
0
 
LVL 1

Author Comment

by:JElster
ID: 39230165
nevermind got it
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question