Hidden variable Vs Server variable accessing on client side in javascript
<p>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.</p>

<p>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.</p>

<ol>
<li><p>Create a public variable or property on server side and set it to javascript variable on client side as below:</p>

<pre><code>var value = eval(&lt;% =value %&gt;);
</code></pre></li>
<li><p>Create a asp hidden variable and set value in this hidden variable from server side and access it through javascript using document.getElementById().</p></li>
</ol>

<p>Which is the best approach and what are the pros and cons?</p>
