0

Hi friends,

I am facing this problem while adding a panel to another panel. Please give me the solution. I have put my code below.

Dim pan As Panel = DirectCast(UserControlTest1.FindControl("Pan_ItemBind"), Panel)
                pan.Controls.Add(Panel1)

Thanks in advence...

Edited by murugavel84: n/a

3
Contributors
4
Replies
6
Views
7 Years
Discussion Span
Last Post by jarceri
0

Hi friends,

I am facing this problem while adding a panel to another panel. Please give me the solution. I have put my code below.

Dim pan As Panel = DirectCast(UserControlTest1.FindControl("Pan_ItemBind"), Panel)
                pan.Controls.Add(Panel1)

Thanks in advence...

hey what is UserControlTest1 ? can you please explain in detail ?

0

hey what is UserControlTest1 ? can you please explain in detail ?

hey the usercontroltest1 having a radgrid and three buttons. Am using this control in my page.

0

Okay...not sure... but this exception occurs only if there is too many nested method calls.. Also just make sure there is "Pan_ItemBind" exist in your usercontroltest1 ...

0

Hi friends,

I am facing this problem while adding a panel to another panel. Please give me the solution. I have put my code below.

Dim pan As Panel = DirectCast(UserControlTest1.FindControl("Pan_ItemBind"), Panel)
                pan.Controls.Add(Panel1)

Thanks in advence...

The way we would do this in C# is a s follows.

Panel childPanel = new Panel();
            parentPanel.Controls.Add(childPanel);

            /* Let's see if the parent panel has our new panel */
            if (parentPanel.HasControls())
            {
                foreach (Control ctl in parentPanel.Controls)
                {
                    if (ctl.GetType() == typeof(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.