Passing first values in drop down list when clicking search button
<p>I have an asp Button and four drop down lists that are populated dynamically from a database.  When clicking the button, supposed to pass the selected values from the drop down list to a SQL stored procedure.  Instead the first value in each drop down list is being passed instead of the selected value.  Here is the code on the aspx page:</p>

<pre><code>&lt;asp:DropDownList runat="server" ID="ddlCountry" AppendDataBoundItems="True"&gt;
&lt;/asp:DropDownList&gt;
&amp;nbsp;
&lt;asp:DropDownList runat="server" ID="ddlTypeStructure" AppendDataBoundItems="True"&gt;
 &lt;/asp:DropDownList&gt;
&amp;nbsp;
&lt;asp:DropDownList runat="server" ID="ddlCategory" AppendDataBoundItems="True"&gt;
&lt;/asp:DropDownList&gt;
&amp;nbsp;
&lt;asp:DropDownList runat="server" ID="ddlSegment" AppendDataBoundItems="True"&gt;
&lt;/asp:DropDownList&gt;
&amp;nbsp;
&lt;asp:Button runat="server" ID="btnSearhProjects" Text="Go" 
    CausesValidation="False" onclick="btnSearhProjects_Click" UseSubmitBehavior="False" /&gt;
</code></pre>

<p>And here is the C# code behind for the button:</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindCountries();
            BindCategories();
            BindSegments();
            BindStructures();

        }



    }
public void SearchProjects()
    {
        Project project = new Project();
        string country = ddlCountry.SelectedItem.Text;
        string category = ddlCategory.SelectedItem.Text;
        string segment = ddlSegment.SelectedItem.Text;
        string structure = ddlTypeStructure.SelectedItem.Text;
        List&lt;Project&gt; projectList = project.GetProjects(country, category, segment, structure);
        gvProjects.DataSource = projectList;
        gvProjects.DataBind();
    }

    protected void btnSearhProjects_Click(object sender, EventArgs e)
    {
        SearchProjects();
    }
</code></pre>

<p>And this is how I am populating each drop down list:</p>

<pre><code>public void BindCountries()
    {
        List&lt;Country&gt; countryList = new List&lt;Country&gt;();
        Country country = new Country();
        countryList = country.GetCountries();

        ddlCountry.DataTextField = "CountryName";
        ddlCountry.DataValueField = "CountryID";
        ddlCountry.DataSource = countryList;
        ddlCountry.DataBind();

    }
</code></pre>

<p>I have tried using <code>ddlCountry.SelectedValue.Text</code> and <code>ddlCountry.SelectedItem.Value</code> and they do not work.  Any help would be greatly appreciated.  Thank you.</p>
