HighTechTalks DotNet Forums  

Re: Controls

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Re: Controls in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Robozel
 
Posts: n/a

Default Re: Controls - 07-01-2003 , 02:21 PM






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





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.