Advertisement

05.08.2008 at 09:05PM PDT, ID: 23388410
[x]
Attachment Details

Dynamic Control

Asked by power98888 in .NET Framework 2.0, Microsoft Visual C#.Net

Tags: c#

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(TextBox1);
}

The question is that how to change the code of form1.Controls.Add(TextBox1); to use in the content page because it is
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>

I am thinking it is Content1.Controls.Add(TextBox1); but it is not correct.  Please help.Start Free Trial
[+][-]05.08.2008 at 11:22PM PDT, ID: 21530704

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET Framework 2.0, Microsoft Visual C#.Net
Tags: c#
Sign Up Now!
Solution Provided By: power98888
Participating Experts: 0
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628