title: Access ASP.NET session variable from JavaScript
body: <p>When the code <code>var accNo = '&lt;%=Session["hdnAccession"]%&gt;';</code> will be executed ?. I change the session variable in the <code>Page_LoadComplete</code> event, but when I access it using <code>var accNo = '&lt;%=Session["hdnAccession"]%&gt;';</code>, it always return the value which I set FIRST. In <code>Page_LoadComplete</code>, I do like the following... <code>Session["hdnAccession"] = GetNewAccession()</code>, When I debugged, I saw that the <code>Session["hdnAccession"]</code> updated each time. But why it do not get updated in JavaScript ?. I am in a situation where I can not use <code>HiddenField</code> instead of <code>Seession</code>. </p>