title: Yet another viewstate dropdownlist issue
body: <p>I have the following code in the <code>Page_Load</code> method of a web form:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      CountrySelectButton.Click += new EventHandler(CountrySelectButton_Click);
  
      if (HomePage.EnableCountrySelector) //always true in in this case
      {
          if(!IsPostBack)
              BindCountrySelectorList();
      }
  }
  </code></pre>
  
  <p>The <code>BindCountrySelectorList</code> method looks like this:</p>
  
  <pre><code>private void BindCountrySelectorList()
  {
      NameValueCollection nvc = HttpUtility.ParseQueryString(HomePage.CountryList);
  
      var ds = nvc.AllKeys.Select(k =&gt; new { Text = k, Value = nvc[k] });
  
      CountrySelector.DataSource = ds;
      CountrySelector.DataTextField = "Text";
      CountrySelector.DataValueField = "Value";
      CountrySelector.DataBind();
  }
  </code></pre>
  
  <p>And I have a <code>LinkButton</code> click event handler which gets the <code>SelectedValue</code> from the <code>SelectList</code> as so:</p>
  
  <pre><code>void CountrySelectButton_Click(object sender, EventArgs e)
  {
      //get selected
      string selectedMarket = CountrySelector.SelectedValue; //this is always the first item...
  
      //set cookie
      if (RememberSelection.Checked)
          Response.Cookies.Add(new HttpCookie("blah_cookie", selectedMarket) { Expires = DateTime.MaxValue });
  
      //redirect
      Response.Redirect(selectedMarket, false);
  }
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>This is the DDL and LinkButton definition:</p>
  
  <pre><code>&lt;asp:DropDownList runat="server" ID="CountrySelector" /&gt;
  &lt;asp:LinkButton runat="server" ID="CountrySelectButton" Text="Go" /&gt;
  </code></pre>
  
  <p>Resulting markup:</p>
  
  <pre><code>&lt;select name="CountrySelector" id="CountrySelector"&gt;
      &lt;option value="http://google.com"&gt;UK&lt;/option&gt;
      &lt;option value="http://microsoft.com"&gt;US&lt;/option&gt;
      &lt;option value="http://apple.com"&gt;FR&lt;/option&gt;
  &lt;/select&gt;
  &lt;a id="CountrySelectButton" href="javascript:__doPostBack('CountrySelectButton','')"&gt;Go&lt;/a&gt;
  </code></pre>
  
  <p><strong>END EDIT</strong></p>
  
  <p>ViewState is enabled but the <code>SelectedValue</code> property only ever returns the first item in the list regardless of which item is actually selected. I'm certain I'm missing something obvious but I can't find the problem; any help is much appreciated.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Dave</p>