check if listbox count changed
<p>I have two listboxs in an asp:wizard "in step 2 there is a step before and step after it. By using some code i take some items from the first listbox to the second one 
I want to check if the count of the second one changed. What I can do ?</p>

<p>This is my listbox code </p>

<pre><code>&lt;asp:ListBox ID="registerCompCats" runat="server" CssClass="ListBox1"
  ClientIDMode="Static" DataTextField="value" DataValueField="key" Rows="5"  
  size="5" style="width:135px; size:5px;" SelectionMode="Multiple" &gt;&lt;/asp:ListBox&gt;

&lt;img id="addCat" src="images/buttons/btn_addCat.jpg" title="Add Category"/&gt;

&lt;asp:ListBox ID="registerCompAcats" runat="server" CssClass="ListBox2"
  ClientIDMode="Static" DataTextField="value" DataValueField="key" Rows="5" 
  size="5" style="width:135px; size:5px; margin-top: 0px;" SelectionMode="Multiple"&gt;&lt;/asp:ListBox&gt;
</code></pre>

<p>This code works well and move items but after finishing the wizard the second listbox is empty. What I can do?</p>

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

<p>that is the java script code that take data from listbox1 to listbox2 </p>

<pre><code> $('#addCat').click(function () {
            $(".ListBox1 &gt; option:selected").appendTo(".ListBox2");
            sortlist(".ListBox1 &gt; option");
            sortlist(".ListBox2 &gt; option");
            selectAll();
        });
</code></pre>

<p>and that is the code behind that check for items and add them to the other list </p>

<pre><code>for (int i = 0; i &lt; rc.CategoriesIDs.Count; i++)
        {
            var foundcat = registerCompCats.Items.FindByValue(rc.CategoriesIDs[i].ToString());
            if (foundcat != null)
            {
                registerCompAcats.Items.Add(foundcat);
                registerCompCats.Items.Remove(foundcat);
            }
        }
</code></pre>

<p>if you need any other code i can post it agian</p>
