Generate multiple Textbox dynamically on button click in asp.net-Collection of common programming errors
Its simple…Just create the Texbox object and add the control to your div as like below example….Make sure that your adding control id is unique…..
HtmlGenericControl dynDivtxtBx = new HtmlGenericControl("div");
dynDivtxtBx.Attributes.Add("class", "divClass");
TextBox txtDegree = new TextBox();
txtDegree.ID = "txtDegree1";
txtDegree.MaxLength = 50;
dynDivtxtBx.Controls.Add(txtDegree);