views:

23

answers:

2

get the value of Global variable in javascript example var a="priti"

so want to access "a" in code behind as it's global varible

A: 

What you call code behind executes on the server and it cannot access javascript variables. One way would be to pass the value of this variable in a HTML form so that it is included the next time you submit it or send it via AJAX. Depending on what you are trying to do there might be other possibilities.

Darin Dimitrov
A: 

Since javascript is executed on client side to use the values in javascript you need to send it to server side, you can do so using Page Methods.

Vinay Pandey