title: Visible list item
body: <p>I am using a list to display a menu and trying to restrict menu items to certain users.</p>
  
  <p>Example here is my menu:</p>
  
  <pre><code>&lt;ul&gt;
      &lt;li id="link1" runat="server"&gt;Link 1&lt;/li&gt;
      &lt;li id="link2" runat="server"&gt;Link 1&lt;/li&gt;
      &lt;li id="link3" runat="server"&gt;Link 1&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I can easily write something like:  </p>
  
  <pre><code>if(User == "") {
  
      link1.Visible = false;
      link2.Visible = false;
  }
  link3.Visible = true;
  </code></pre>
  
  <p>But I want to use a loop to reference the list item ids in an array.
  I am trying to make this code work: So that it should read
  <code>link1.Visible = ... link2.Visible = ...</code> but I cannot use <code>link.Visible</code> in that way. How can I make this work? </p>
  
  <p>Many thanks</p>
  
  <pre><code>ArrayList links = bw.return_arr_qry("Links", "BW_AppPerms", "Ext_App = 1");
  
  // Links array return "link1", "link2", "link3" etc...
  
  foreach(string link in links)
  {
      if (BW_Access.accessApp(link, "Read") == false)
      {
          link.Visible = false;
      }
  }   
  </code></pre>