Hi, first remove the control from its parent controls collection them add it
to the form controls.
ad-hoc slice of code :
c.Parent.Controls.Remove(c);
myCotnrol.Page.Controls.Add(c);
HTH,r.
"Viorel Ghilas" <vghilas (AT) hotmail (DOT) com> wrote
Quote:
Hi all
I make a control and put it on the form. My control search on the page
something and if it doesn't found must add one control on the form. I try
myCotnrol.Page.Controls.Add(c) and I get error "A control cannot modify
its
parents' control collections.". How can I add a control to form from my
control?
with best regard
Viorel Ghilas |