Add a TextBox control at runtime on the form. - ASP.NET HTML and Web Server Control
Q. How will you add a TextBox control at runtime on the form? Choose the correct one.- Published on 27 Jul 15a. TextBox obj = new TextBox();
obj.ID = "txtUserName";
form1.Controls.Add(obj);
b. form1.Controls.Add(TextBox);
c. this.FindControl.add(TextBox);
d. None of the above.
ANSWER: TextBox obj = new TextBox();
obj.ID = "txtUserName";
form1.Controls.Add(obj);