How to write asp button control at run time?
<p>I am wring a button control like below.
i have got a method that has got a little code like below i mentioned.
i tried it in two ways but both don't work. onw with btn object, second with direct writing it. 
i need to create all three buttons on run times for N number of items, ans all buttons will have some common things except there identity. Please suggest me a little how to make it work.</p>

<pre><code> Button btn = new Button();
            btn.ID = "btnDress" + x;
            btn.CommandName = "DressBtn";
            btn.Text = "Dressing";
            btn.CommandArgument = x.ToString();
            btn.UseSubmitBehavior = true;
            btn.Click += new EventHandler(btnDress_Click);

void draw()
{
 drawItem = drawItem + @" &lt;div class=new_options&gt;
                    &lt;ul&gt;
                        &lt;li&gt;
                            "+btn+ @"&lt;/li&gt;
                        &lt;li&gt;
                            &lt;asp:Button ID='btnSpInst_'" + x + @" runat='server' CommandName='SpeInstBtn' Text='Special Instruction'
                                OnClick='btnDress_Click' CommandArgument='" + x + @"' /&gt;&lt;/li&gt;
                        &lt;li&gt;
                            &lt;asp:Button ID='btnTopp_'" + x + @" runat='server' CommandName='ToppBtn' Text='Toppings' OnClick='btnDress_Click' CommandArgument='" + x + @"' /&gt;&lt;/li&gt;
                    &lt;/ul&gt;
                    &lt;div class='clear'&gt;
                    &lt;/div&gt;";

            x++;
}
</code></pre>

<p>the problem with this code is that for ever div i need to write 3 buttons on fly which has got some fix parameters, like i mentioned for the asp buttons which i tried to farm but those write as an string and don't work, could some body tell me how can i achieve the above thing to work.</p>

<p>this is the html which i need to redraw for items. on fly, here i have kept button but in reality i want to generate it on fly.</p>

<pre><code> &lt;div class="new_options"&gt;
                    &lt;ul&gt;
                        &lt;li&gt;
                            &lt;asp:Button ID="Button4" runat="server"   Visible="true" CommandName="DressBtn" Text="Dressing" OnClick="btnDress_Click" /&gt;&lt;/li&gt;
                        &lt;li&gt;
                            &lt;asp:Button ID="Button5" runat="server" Visible="true" CommandName="SpeInstBtn" Text="Special Instruction"
                                OnClick="btnDress_Click" /&gt;&lt;/li&gt;
                        &lt;li&gt;
                            &lt;asp:Button ID="Button6" runat="server" CommandName="ToppBtn" Visible="true" Text="Toppings" OnClick="btnDress_Click" /&gt;&lt;/li&gt;
                    &lt;/ul&gt;
                    &lt;div class="clear"&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
</code></pre>
