Using global variable versus hidden field
Is there any difference between using a global variable in client script & hidden field for storing values Other than "hidden field values can be accessed from code behind also, where as global variable in client script can be used in client script only"?

Debashis MohapatraPosted Nov 10, 2014, 8:44 AM
Global Variables in scripting , you would still be using that inside the .js file or among the script functions and the value you assign to them still cannot be used by your server side code but lets say you want a value to be shared between the server side code and the client side code i.e you want to pass some value from client side to server side or vice verse when you are not using any web methods / AJAX calls then you make use of hidden fields .
Please let me know if you have questions still .
Rasmita DashPosted Oct 28, 2014, 8:26 AM
Lawrence PondPosted Oct 27, 2014, 12:42 AM
I am assuming you are refering to web development. To me global variable are typically stored on the server side. Hidden field values would be on the client side and example retrieved on a client side event without having to make a round trip to the server and then back to the client.
If you just need this variable in the client script I would suggest using a hidden field or if you want it stored you could use a cookie.
Rasmita DashPosted Oct 24, 2014, 7:15 AM
Rajendra TripathyPosted Oct 8, 2014, 8:00 AM
There is a very nice article on – "Hidden field".. Please go through this.
http://dotnet.dzone.com/news/aspnet-client-side-state-manag-0