title: Listbox item move is moving the wrong items
body: <p>I have some C# functions that are supposed to move <code>ListItems</code> from one ASP.NET <code>ListBox</code> to another, and this is what they look like:</p>
  <pre><code>protected void btnSelectRec_Click(object sender, EventArgs e)
  {
      MoveListedItem(lbPotRecips, lbRecips);
  }
  protected void btnDeselectRec_Click(object sender, EventArgs e)
  {
      MoveListedItem(lbRecips, lbPotRecips);
  }
  private void MoveListedItem(ListBox lbSender, ListBox lbReceiver)
  {
      List&lt;ListItem&gt; removed = new List&lt;ListItem&gt;();
      foreach (ListItem item in lbSender.Items)
          if (item.Selected)
          {
              item.Selected = false;
              lbReceiver.Items.Add(item);
              removed.Add(item);
          }
      foreach (ListItem item in removed)
          lbSender.Items.Remove(item);
  }
  </code></pre>
  <p>I've noticed in my tests that this only seems to work about 3/5 of the time.
  Though, since there are plenty of times when I click something on <code>lbSender</code>, then <code>btnSelectRec</code>, and the item move initiates.
  But, sometimes the item on <code>lbReceiver</code> is completely different.</p>
  <p>I looked and saw this might have something to do with my scroll position, which can cause the <code>foreach</code> loop to mess up and think, for ex, that <strong>the second item in view is the second in the list overall</strong>, when this is completely wrong.</p>
  <p>For a moment I thought the <code>listbox</code> was being weirdly specific about the position of the item selected, but considering that this issue only sometimes occurs regardless of my position, I'm now at a loss with what could be causing this mismatch. Any help would be appreciated!</p>