开发者

access javascript global variable from codebehind in asp.net

开发者 https://www.devze.com 2023-01-07 14:33 出处:网络
get the value of Global variable in javascript example var a=\"priti\" so want to access \"a\" in cod开发者_JAVA技巧e behind as it\'s global varibleWhat you call code behind executes on the server

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

so want to access "a" in cod开发者_JAVA技巧e behind as it's global varible


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号