title: Setting styles through code on html elements. Is there better way?
body: <p>I came across some code like this:</p>
  
  <pre><code>public string IsAdmin()
  {
      string style = "";
  
      if(EditUserName == "")
      {
          style = "visibility:hidden;display:none";
      }
      return style;
  }
  </code></pre>
  
  <p>Then in the html, I see something like this:</p>
  
  <pre><code> &lt;table style='&lt;%= IsAdmin() %&gt;'&gt;
   &lt;/table&gt;
  </code></pre>
  
  <p>The above doesn't seem the best way to do this.  Is there a more efficient and alternative way to set the style of html elements programmatically.</p>