protected void Button1_Click(object sender, EventArgs e) { { if (txtQuantity.Text != "") { for (int i = 0; i < Convert.ToInt16(txtQuantity.Text); i++) { Label la = new Label(); la.Text = ddlProductName.SelectedItem.Value + i.ToString(); la.ID = "abc" + i.ToString(); PlaceHolder1.Controls.Add(la); //la = FindControl(String.Format(i)) as Label; TextBox txtbox = new TextBox(); txtbox.Text = "Textbox - " + i.ToString(); PlaceHolder1.Controls.Add(new LiteralControl("<input id='txt' name='Textbox" + i + "'type='text' />")); PlaceHolder1.Controls.Add(new LiteralControl(" ")); } } } }
hope so you are missing to add the textbox control to PlaceHolder TextBox txtbox = new TextBox(); txtbox.Text = "Textbox - " + i.ToString(); PlaceHolder1.Controls.Add(txtbox);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)