0

Hello,

I wish to know the protected property ChildControlsCreated property (to know the childrens of the Panel) when a button is clicked. Please tell me where I am wrong.The Label3.text should show "True" but displaying "false". why is that so?

It is the same for other properties like adapter.

regards

Manoj

protected void Button1_Click(object sender, EventArgs e)

{

    Panel pp = new Panel();

    TextBox t1 = new TextBox();

    pp.Controls.Add(t1);

    TextBox t2 = new TextBox();

    pp.Controls.Add(t2);


    class2 cc = new class2();

//Boolean bb2 = cc.xx1();

    Boolean bb2 = cc.b1;

    Label3.Text = bb2.ToString();

}

public class class2 : Panel

{ 

   public Boolean b1;

   public void xx1()

   {

      Panel pp = new Panel();

      TextBox t1 = new TextBox();

      pp.Controls.Add(t1);

      TextBox t2 = new TextBox();

      pp.Controls.Add(t2);

      b1 =base.ChildControlsCreated;

   }

}
3
Contributors
2
Replies
6
Views
4 Years
Discussion Span
Last Post by tinstaafl
0

My understanding is the property you're looking for is available through webcontrols, you might need something like this:

public class class2 : System.Web.UI.WebControls.Panel
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.