DropDownList No Value
<p>I'm sure this is pretty simple (been up all night with teething daughter!) my drop down list is always returning 0:</p>

<pre><code>&lt;p&gt;
    &lt;asp:DropDownList ID="ddlSelectVenue" AppendDataBoundItems="true" CssClass="small-dropdownlist" DataTextField="SiteName" DataValueField="SiteName" runat="server"&gt;
        &lt;asp:ListItem Text="-- select --" Value="0"&gt;&lt;/asp:ListItem&gt;
    &lt;/asp:DropDownList&gt;
&lt;/p&gt;
</code></pre>

<p>Here's the code that populates it:</p>

<pre><code>for (int i = 0; i &lt; dArray.Length; i++)
{
    ddlSelectVenue.Items.Add(new ListItem(dArray[i]["SiteName"].ToString(),dArray[i]["SiteName"].ToString()));
}
</code></pre>

<p>It does contain values, here's a snippet of the page source:</p>

<pre><code>&lt;select name="ctl00$ddlSelectVenue" id="ctl00_ddlSelectVenue" class="small-dropdownlist"&gt;
&lt;option value="0"&gt;-- select --&lt;/option&gt;
&lt;option value="Admiral Duncan - London"&gt;Admiral Duncan - London&lt;/option&gt;
&lt;option value="Anchor - Bristol"&gt;Anchor - Bristol&lt;/option&gt;
&lt;option value="Assembly - Preston"&gt;Assembly - Preston&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>Here's the Go button HTML:</p>

<pre><code>&lt;asp:ImageButton ID="imbGo" ImageUrl="~/img/GoButton.png" OnClick="imbGo_Click" runat="server" /&gt;
</code></pre>

<p>And here is the imbGo_Click (well part of it):</p>

<pre><code>protected void imbGo_Click(object sender, EventArgs e)
{
    switch(ddlSelectVenue.SelectedValue)
    {
        case "Admiral Duncan - London":
            Response.Redirect("http://www.welovetolisten.co.uk?unitcode=5004&amp;FROMWEBSITE=1");
            break;
        case "Anchor - Bristol":
            Response.Redirect("http://www.welovetolisten.co.uk?unitcode=3010&amp;FROMWEBSITE=1");
            break;
        // ...
    }
}
</code></pre>

<p>It's always bombing to default: as I said it's probably obvious why, but I'm just not seeing it!</p>

<p><strong>EDIT</strong></p>

<p>I've solved it using this, but I will accept the first person who said about posting back as that was the issue, what I don't understand is I have use drop down lists that have been populated on PageLoad before and not had this sort of problem.</p>

<p>Anyway, I have set a cookie on the drop down list changing using jQuery instead:</p>

<pre><code>$('.small-dropdownlist').change(function () {
            var info = $('.small-dropdownlist option:selected').text();
            $.cookie("FeedbackVenue", info);
        });
</code></pre>

<p>Then read the cookie in on the Go button:</p>

<pre><code>if(Request.Cookies["FeedbackVenue"] != null)
        {
            venue = Request.Cookies["FeedbackVenue"].Value;
        }

        switch(venue.Replace("%20"," "))
</code></pre>

<p>Now it works.</p>

<p>Thanks everyone.</p>
