title: ASP ListBox returns -1
body: <p>I have a an ASP listBox. Whenever I select a new item in the list, the following function gets called:</p>
  
  <pre><code> protected void prevSubList_SelectedIndexChanged(object sender, EventArgs e)
   {
          // Get the currently selected item in the ListBox index
          int index = prevSubList.SelectedIndex;
          if (index &lt; 0)
          {
              return;
          }
          //get the nominee for that index
          Nominees currNominee = nominees[index];
          populateFields(currNominee);
      }
  
  
  &lt;td ID="previousSubmissions" align="left"&gt;
      &lt;asp:ListBox ID="prevSubList" runat="server" Height="16px" Width="263px" 
       Rows="1" onselectedindexchanged="prevSubList_SelectedIndexChanged" 
       AutoPostBack="True"&gt;
       &lt;/asp:ListBox&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>The problem is <code>int index = prevSubList.SelectedIndex;</code> always evaluates to -1. There are three items in my list, say I select the second one, I would expect the value to be 1, but it is -1. Any ideas why?</p>