Friday, April 29, 2011

dynamic generation of text boxes in button click using c#

static int i=0;

protected void Button2_Click(object sender, EventArgs e)
{
n++;


int i = 0;

TextBox[] tb = new TextBox[n + 1];

for (i = 0; i <= n - 1; i++)
{

tb[i] = new TextBox();
dynsmicpnl.Controls.Add(tb[i]);
dynsmicpnl.Controls.Add(new LiteralControl("
"));

}
}

No comments:

Post a Comment