Web Development

Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!

General discussion


Session Variable

By sp_bannore ·
Hello Everyone,
I want to store the value in session variable But this is not working at the
Server side.I am not able to access this
value in the vb code Plz suggest me what i can do for this?
Otherwise what could be the other reasons that this value is not getting stored in the session variable

<script language=javascript>
function abc()
var a=1;


Swati Jain

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by Y2KSUNDARA In reply to Session Variable

HI u cannot access server side session variable in javascript. you need to access it in codebehind vb code

Collapse -

by StreamLogic In reply to Session Variable


As previously answered, you cannot access server-side objects via client-side code. However, here is an alternative solution that may help you:

Within your Javascript code, use the XMLHTTP object to asyncronously POST to an ASP/ASPX page, maybe called p_setsessions.asp. Within this POST you can set the data to send and send the session variable name and the JS value.

This .asp page would then take these params, set the session variable, and then return to your client-side JS code.

I would be happy to share some example code if you would like. Pls. email me.

StreamLogic Inc.

Related Discussions

Related Forums