0

Hi all I am assigning a Session variable using Javascript as follows, I am using devexpress controls

<script type="text/javascript">
    function f() {
        var v = textBox1.GetValue();
        <%Session["Demo"] = v;%>
        var sValue='<%=Session["Demo"]%>';
        textBox3.SetValue(sValue);
    }
</script>

This is giving an error on webpage when I run as The name 'v' does not exist in the current context

So can some one help me what to do

1
  • Cannot be done , JS executes in client side . Commented Aug 8, 2013 at 6:46

1 Answer 1

2

As @The New Idiot mentioned - it cannot be done on a client side, since Session objects are stored on a server side. The only way you can do it is on some request get/post or even ajax request and set variable on a server side

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.