.aspx page - using document.getElementById in pageLoad()
<p>In writing a .net web application using AJax, should I <em>always</em> use global variables to store controls within the pageLoad() function?</p>

<p><strong>Example -</strong></p>

<pre><code>  var x;
  var y;

  function pageLoad() {

            x = document.getElementById("&lt;%= cboX.ClientID %&gt;");
            y = document.getElementById("&lt;%= tbxY.ClientID %&gt;");  
  }

  function doStuff1() {

            x.enabled = false;
            y.style.visibility = "visible";
  } 
</code></pre>

<p><strong>Or in some cases should I do this -</strong></p>

<pre><code>    function doStuff2() {

            document.getElementById("&lt;%= cboX.ClientID %&gt;").enabled = false;
            document.getElementById("&lt;%= tbxY.ClientID %&gt;").style.visibility = "visible";
  } 
</code></pre>
