Hi
try adding your dynamic controls in
Page_Init
method, It will work...
protected void Page_Init(object sender, EventArgs e)
{
TextBox txt = new TextBox () { ID="txt"};
divContainer.Controls.Add(txt);
}
protected void Button1_Click(object sender, EventArgs e)
{
var text = divContainer.FindControl("txt") as TextBox;
text.Text = "modified";
}