Hidden variable Vs Server variable accessing on client side in javascript

beilbomma

New Member
I'm evaluating two options of accessing a server side data on client side. Little bit confused about the efficiency or may be you can call it as finding best approach to do it.I need to access a server side data may be an integer value in javascript on client side. I know about two options to do it.[*]Create a public variable or property on server side and set it to javascript variable on client side as below:\[code\]var value = http://stackoverflow.com/questions/3243632/eval(<% =value %>);\[/code\][*]Create a asp hidden variable and set value in this hidden variable from server side and access it through javascript using document.getElementById().Which is the best approach and what are the pros and cons?
 
Top