title: .net DropDownList gets cleared after postback
body: <p>This has been driving me nuts all day. I've seen this problem crop up here a few times, essentially I have a drop down list that populates a form below when it's changed - basic stuff. On first page load everything is fine, but when the dropdownlist is changed, it's entirely blank after postback and the SelectedIndexChanged event never fires. I believe it all points to a viewstate problem. Here's the code..</p>
  
  <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeFile="EditUser.ascx.cs" Inherits="Controls_EditUser" %&gt;
  &lt;asp:DropDownList OnSelectedIndexChanged="SelectedIndexChanged" AutoPostBack="true" ID="UsersList" EnableViewState="true"
      runat="server" DataTextField="EXTRANET_USER_EMAIL" DataValueField="EXTRANET_USER_ID"&gt;
  &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>and the pageload...</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (!IsPostBack)
      {
          IEnumerable&lt;ExtranetUser&gt; users = Users();
          UsersList.DataSource = users;
          UsersList.Items.Insert(0, new ListItem("-- Select User --", "0"));
          UsersList.DataBind();
      }
  }
  </code></pre>
  
  <p>Any help on this would be hugely appreciated! I'm sure it's something simple...</p>