J
jatiner84
What is process for adding text box and button at run time.
What is process for adding text box and button at run time.
What is process for adding text box and button at run time.
You cannot add textbox control to page.Controls collection directly
because
you'll get an exception ('TextBox' must be placed inside a form tag with
runat=server). This is because HtmlForm is contained within controls
collection, so you could use this.Controls[3].Add() which is obviously
c**p
or use placeholder or any container control :
placeHolder1.Controls.Add()
You have to recreate dynamic controls on every request
protected void Page_Load(object sender, EventArgs e)