Adding controls to the page from a web control
public class MyCustomControl : WebControl
{
protected overriede void OnLoad ( EventArgs e )
{
this.Page.Controls.Add ( new TextBox ( ) ) ;
}
}
Of course this causes an exception which says "The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases". This exception implies that I will not be able to add controls to the page in this manner. I`m wondering, why can`t I do this. Is there another way to do this?

