Adding textbox to gridview at runtime
ASP.NET
2
Posts
2
Posters
0
Views
1
Watching
-
Hello friends, I am using gridview and want to add textbox at runtime. The no of textboxes to add depends upon certain value. Is is possible? How? pls help me...thnx in advance..!
To add a textbox runtime just try protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["txt"] = 0; } } public void name(object sender, EventArgs e) {int txt = (int)ViewState["txt"]; TextBox txt1 = new TextBox(); txt1.ID = "txt" + (++txt).ToString(); Panel1.Controls.Add(txt1); txt1.Text = ; ViewState["txt"] = txt; } After creating a Panel in the .aspx page. Can't understand why u need gridview. Hope it helps BYE