ASP.NET: Show/hide radio button list items programmatically
<p>I need to know how to do what the following would intuitively do if it worked (imagine <code>useGreek()</code> and <code>useNato()</code> to be states that would be consulted once per load or postback):</p>

<pre><code>&lt;asp:radioButtonList id="rbl" runat="server" autoPostBack="true"&gt;
    &lt;asp:listItem value="alpha" text="Alpha" /&gt;
    &lt;% if(useGreek()) { %&gt;
        &lt;asp:listItem value="beta" text="Beta" /&gt;
        &lt;asp:listItem value="gamma" text="Gamma" /&gt;
    &lt;% } else if(useNato()) { %&gt;
        &lt;asp:listItem value="bravo" text="Bravo" /&gt;
        &lt;asp:listItem value="charlie" text="Charlie" /&gt;
    &lt;% } %&gt;
    &lt;asp:listItem value="delta" text="Delta" /&gt;
&lt;/asp:radioButtonList&gt;
</code></pre>

<p>(It will already be apparent that I'm not usually asked to write for IIS.)</p>

<p>Anyway, ASP.NET doesn't like code interleaved with list items, so this is a no-go. I imagine that there's some C#-based way to handle this somehow, but I've been trying for a few days now with no luck.</p>

<p>Also, just to be clear, I'm seeking a server-side solution here. I'm well-versed with jQuery, but we're trying to keep most of the processing of this particular form off the client.</p>

<p>Thanks, and party on.</p>
