asp.net - Persisting Session State via multiple request using jQuery $.ajax() -


just been trying recieve session value multiple jquery ajax requests on same domain name. think understand each request kind of virtual browser request session mutally exclusive each request, there must way how, has solved this. im trying do:

i have tries using type: , post still no luck.

can please, thanks?

first request - stores product id in session

$.ajax({

    url: 'http://localhost/websitetest/test.aspx?storeproduct=' + productid,     type: 'get',       async: true,     success: function(data) {     } 

});

second request - callback variable "data" recieves product id session

$.ajax({      url: 'http://localhost/websitetest/test.aspx,     type: 'get',       async: true,     success: function(data) {           var productid = data;     } }); 

there no question send ajax request while accessing session variable asp page.

simply can :

<% string session_var = session("name_of_session_variable"); %> 

even if still want try ajax, think need print session variable in test.aspx file using response.write(), automatically return content.

please check this further reference.

please correct me if wrong.

thank you.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -