More
Image
How to add dynamic controls in ASP.NET
By JC.Adinarayana Reddy On 20 Dec 2016
Categories: Asp.net
Below code will add a dynamic TextBox to the "form1" in webpage,  with the id "txtName".
 
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
TextBox tx = new TextBox();
tx.ID = "txtName";
form1.Controls.Add(tx);
}
}

Comments
Message :
Comments
JC.Adinarayana Reddy
.net
.net