placing dynamic checkboxes
<p>I need to moved the selected items from the list box from the left side to the listbox on the right side. Along with moving the seleted items, I need to dynamically create two check boxes right next to the item that is being added so for e.g</p>

<p>ListBox1                      ListBox2</p>

<p>A                                 A      checkBoxcreatedhere  CheckboxCreatedHere</p>

<p>B         add Button</p>

<p>C</p>

<p>D</p>

<p>so in the above e.g I selected A from ListBox1. Right next to the listBox2, i want two checkboxes to be created dynamically. i am trying to do that. but somehow these checkes are not placed exactly after the item that is moved to listbox2. below is my code</p>

<pre><code> protected void img_Add_Click(object sender, ImageClickEventArgs e) 
        { 
            CheckBox chkList1; 
            int count=0; 
            foreach (ListItem item in ListBox1.Items) 
            { 
                count++; 
                if (item.Selected) 
                { 
                    ListBox2.Items.Add(new ListItem(item.Text, item.Value)); 
                    chkList1 = new CheckBox(); 
                    chkList1.ID = "Chk" + count; 
                    pnlCheckBoxes.Controls.Add(new LiteralControl("&lt;td&gt;")); 
                    pnlCheckBoxes.Controls.Add(chkList1); 

                    pnlCheckBoxes.Controls.Add(new LiteralControl("&lt;br&gt;")); 
                } 

            } 

    }
</code></pre>

<p>and my .aspx code is like this</p>

<p> </p>

<pre><code>    &lt;asp:Label ID="Lbl1" runat="server" Text="label1" CssClass="cis_edit_label_tiny"&gt;&lt;/asp:Label&gt; 
    &lt;br /&gt; 

    &lt;asp:ListBox ID="ListBox1" runat="server" Width="140px" 
        Height="200px" SelectionMode="Multiple"&gt;&lt;/asp:ListBox&gt; 
&lt;/td&gt; 
&lt;td&gt; 
    &lt;asp:ImageButton ID="img_Add" runat="server" ImageUrl="~/images/add_button.jpg" OnClick="img_Add_Click" /&gt; 
&lt;/td&gt; 
&lt;td style="width: 2%"&gt; 
 &lt;asp:Panel ID="pnlCheckBoxes" runat="server"&gt; 
    &lt;asp:Label ID="label2" runat="server" Text=" label2:" CssClass="cis_edit_label_tiny"&gt;&lt;/asp:Label&gt; 
    &lt;br /&gt; 
    &lt;asp:ListBox ID="ListBox2" runat="server" Width="140px" Height="200px"&gt; 
    &lt;/asp:ListBox&gt; 
 &lt;/asp:Panel&gt; 
&lt;/td&gt;
</code></pre>
