hai........
i have an asp.net page.with four text box controls.I also have a link button .
i want to add 4 text boxes each time i click on the link button.I write code for this but it didnt works well.Only the first time it creates 4 text boxes but when i click the link button again the text box controls are not displayed.
here is my code
Plese give me a solution
i have an asp.net page.with four text box controls.I also have a link button .
i want to add 4 text boxes each time i click on the link button.I write code for this but it didnt works well.Only the first time it creates 4 text boxes but when i click the link button again the text box controls are not displayed.
here is my code
Code:
static count=0; protected void LinkButton1_Click(object sender, EventArgs e) { int q; q = count + 1; TextBox t1 = new TextBox(); t1.ID = "a" + q.ToString(); TextBox t2 = new TextBox(); t2.ID = "b" + q; TextBox t3 = new TextBox(); t3.ID = "c" + q; TextBox t4 = new TextBox(); t4.ID = "d" + q; Panel1.Controls.Add(t1); Panel2.Controls.Add(t2); Panel3.Controls.Add(t3); Panel4.Controls.Add(t4); Panel1.Visible = true; Panel2.Visible = true; Panel3.Visible = true; Panel4.Visible = true; count = count + 1; Response.Write(Panel1.Controls.Count); }
Comment