You can access your session variable as '<% = Session ["VariableName"]%>'
single quoted text will give the value of the session. one)
<script> var session ='<%= Session["VariableName"]%>' </script>
2) you can take a hidden field and assign a value on the server;
hiddenfield.value = session ["xyz"]. tostring ();
//and in script you access the hiddenfield like alert(document.getElementbyId("hiddenfield").value);
Rashmi Kant Shrivastwa
source share