How to store values in the session using jquery.
I am using the following code
var Link = '<%=Session["Link"]%>';
to get data from session. How to do the reverse process.
Problem:
I need this in my master page. so i cant use .ajax{}.
Geetha
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will probably need to set up an HTTP handler or something similar that will accept requests and store things in the Session. Visual studio has this somewhere in the “Add” menus in the solution view. (If you’re using ASP.NET MVC, you just set up another action instead of a generic handler.)
Since those values will may have different types (int, string, etc.) and since you don’t want malicious users poking into any session key they see fit, you will probably want to set up a branch to determine what to do with each key. Something like this (inside the handler that you created):
After that, you’ll need to set up a post HTTP request through jquery that puts whatever values you need in those “key” and “val” fields.