ASP.net c# basic question
<p>Willing to admit I'm a complete .NET newbie, but I have extensive experience in classic ASP, which is making this quite tricky as the whole structure of .net is completely different.</p>

<p>I know I'm meant to use code behind, but for now I'm happy embedding it into the pages because:</p>

<ol>
<li>Each page is going to be simple, so
there wont be too much mixing up</li>
<li>It's probably too much of a step to
do everything the 'right' way, I'd
rather step up to that slowly as I
get to grips with .net</li>
</ol>

<p>So excusing my lack of code behind, on this page I am trying to get the ID returned by the querystring "mid" (Menu ID), and then display a different CSS class for the menu button we are currently on.  Two menu classes, navButton and navButtonO (over).</p>

<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="admin.aspx.cs" Inherits="AlphaPack._Default"
    title="Administration"
%&gt;

&lt;script language="C#" runat="server" &gt;

    protected int menuID;

    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; 
        }

    }     
&lt;/script&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;div class="navButton&lt;%if(menuID == 0){ response.write("O") }%&gt;"&gt;
            &lt;a href="admin.aspx" class="navLink"&gt;Admin Home&lt;/a&gt;
        &lt;/div&gt;  
        &lt;div class="navButton&lt;%if(menuID == 1){ response.write("O") }%&gt;"&gt;
            &lt;a href="users.aspx" class="navLink"&gt;User Manager&lt;/a&gt;
        &lt;/div&gt;    
        &lt;div class="navButton&lt;%if(menuID == 2){ response.write("O") }%&gt;"&gt;
            &lt;a href="products.aspx" class="navLink"&gt;Products&lt;/a&gt;
        &lt;/div&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>Thanks for any help, don't pull any punches.</p>
