title: Javascript comparing boolean value to True
body: <p>I am trying to compare a database (SQL) value (which is being returned correctly) to the boolean value 'true'. If the database bit value is = true then I want a div element to become visible, else stay hidden.</p>
  
  <pre><code>&lt;script language="javascript"&gt;
      window.onload= function show_CTL() {
          if(&lt;%=_CurrentUser.IsCTL%&gt; == true){
              document.getElementById('CTL').style.visibility = "visible";
          } else{
              document.getElementById('CTL').style.visibility = "hidden";
          }
      }    
  &lt;/script&gt;
  </code></pre>
  
  <p>However I am getting the error, Javascript: 'True' is undefined.</p>
  
  <p>I have tried many combinations of &lt;%=_CurrentUser.IsCTL%>  == 'true' or "true" or true or  "True" or 'true' and even the === ... but all give me the same error message.</p>
  
  <p>Any insights on how to resolve this issue will be greatly appreciated.</p>
  
  <p>I have such comparisons successfully before with integer values such as:-</p>
  
  <pre><code> window.onload= function show() {
      if(&lt;%=_CurrentUser.RoleKey%&gt; == 1 || &lt;%=_CurrentUser.RoleKey%&gt; == 2)
              document.getElementById('enr').style.visibility = "visible";
      else
              document.getElementById('enr').style.visibility = "hidden";
   }
  </code></pre>