ASP.net c# change pannel class
<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="admin.aspx.cs" Inherits="******._Default"
    title="Administration"
%&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 
    1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
    &lt;head id="mainHead" runat="server" &gt;
        &lt;title&gt;Administration&lt;/title&gt;
        &lt;link rel="Stylesheet" href="../style/admin.css" /&gt;       
    &lt;/head&gt;
    &lt;body&gt;

    &lt;div class="topMenu"&gt;    

        &lt;asp:Panel id="mnu0" runat="server" class="navButton"&gt;
            &lt;a href="admin.aspx" class="navLink"&gt;Admin Home&lt;/a&gt;
        &lt;/asp:Panel&gt;

        &lt;asp:Panel id="mnu1" runat="server" class="navButton"&gt;
            &lt;a href="admin.aspx" class="navLink"&gt;User Manager&lt;/a&gt;
        &lt;/asp:Panel&gt;

        &lt;asp:Panel id="mnu2" runat="server" class="navButton"&gt;
            &lt;a href="admin.aspx" class="navLink"&gt;Products&lt;/a&gt;
        &lt;/asp:Panel&gt;  

    &lt;/div&gt;

    &lt;br /&gt;&lt;br /&gt;
    &lt;div class="subMenu"&gt;
        &lt;a href="products.aspx" class="subLink"&gt;Products&lt;/a&gt; &lt;a href="productCats.aspx" class="subLink"&gt;Categories&lt;/a&gt; 
    &lt;/div&gt;

    &lt;br /&gt;&lt;br /&gt;
    Welcome to the Admin

    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Code behind:</p>

<p>public partial class _Default : System.Web.UI.Page
{
    protected int menuID;</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{

    string menuIDdata = Page.Request.QueryString["mid"];
    menuID = 0;

    // Check the user is allowed here
    if (!Roles.IsUserInRole("Admin"))
    {
        Response.Redirect("../default.aspx");
    }

    // Get the menu ID
    if (int.TryParse(menuIDdata, out menuID))
    {
        menuID = int.Parse(menuIDdata);
    }
    else
    {
        menuID = 0;
    }

    mnu0.CssClass = "navButtonO";

}   
</code></pre>

<p>}</p>

<p>I'm trying to change the class of the menu depending on which one is selected, but is there an elegant way to change the class instead of a switch/if statement?  For example:</p>

<pre><code>mnu[menuID].CssClass = "navButtonO";
</code></pre>

<p>Would change the class of the menu item.</p>
