I'm adding a Panel to a Panel serverside, then try to access the second panel using FindControl, but it returns null - can anyone tell me what I am missing?
Panel p1 = new Panel();
Panel p2 = new Panel();
p2.ID = "Panel2";
p1.Controls.Add(p2);
// This returns null
Panel tempPanel = (Panel)p1.FindControl("Panel2");
I can see in the 'Watch' window that p2 has been added and has the ID 'Panel2'. FindControl returns null