problem with drop down list
<p>I have a drop down list control populated with items and some code to take the currently selected item value. The problem is I only get the value of the first item in the list regardless of what item is actually selected.</p>

<p>Here is my code to populate the drop down:</p>

<pre><code>protected void displayCreateCategories()
{
    StoreDataContext db = new StoreDataContext();
    var a = from c in db.Categories
                    orderby c.Name
                    select new{catName= c.Name,
                        catId=c.CategoryID};

    ddlCategory.DataSource = a;
    ddlCategory.DataTextField = "catName";
    ddlCategory.DataValueField = "catId";
    ddlCategory.DataBind();   
}
</code></pre>

<p>To get the value of the currently selected item which in my case is always of type integer I do <code>label1.text=Convert.toInt32(ddlCategory.SelectedValue);
</code>
<br /><br />
I get the selected value, but it is always for the 1st item in the list. I'm pulling my hair out over this. :(</p>
