using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
public partial class createtextbox : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//Create textbox dynamically
CreateTexbox();
}
private void CreateTexbox()
{
//limit to ceate textbox
int a = 15;
for (int i = 0; i < a; i++)
{
TextBox txtDynamic = new TextBox();
//Declaring the textbox ID name
txtDynamic.ID = "tb" + "" + ViewState["MyText"] + i + "<br/>";
txtDynamic.Width = 400;
txtDynamic.Height = 20;
txtDynamic.BorderStyle = BorderStyle.Solid;
txtDynamic.Style["Top"] = "25px";
txtDynamic.Style["Left"] = "100px";
txtDynamic.BackColor = Color.DarkGray;
txtDynamic.BorderColor = Color.Coral;
txtDynamic.TextMode = TextBoxMode.MultiLine;
form1.Controls.Add(txtDynamic);
}
}
}