Hi,
I am making the dynamic control on the content page which inherited to a Masterpage.
I know how to add the dynamic control using below code if it is not a content page.
protected override void OnPreInit(EventArgs e)
{
TextBox TextBox1 = new TextBox();
TextBox1.ID = "TextBox1";
TextBox1.Text = "ABC";
form1.Controls.Add(TextBox
1);
}
The question is that how to change the code of form1.Controls.Add(TextBox
1); to use in the content page because it is
<asp:Content ID="Content1" ContentPlaceHolderID="Cont
entPlaceHo
lder1" Runat="Server">
</asp:Content>
I am thinking it is Content1.Controls.Add(Text
Box1); but it is not correct. Please help.
Start Free Trial