469,963 Members | 1,836 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,963 developers. It's quick & easy.

A control cannot modify its parents' control collections.

Hi!!!

I'm trying to add a UserControl created using the
Page.LoadCotnrol("test.ascx") method to a Page's Control collection and
the exception I get is ( the complete stack trace):

[HttpException (0x80004005): A control cannot modify its parents'
control collections.]
System.Web.UI.ControlCollection.Add(Control child)
Akela.WebFramework.Design.TreeView.TreeNode.LoadUs erControl() in
d:\projects\akelahr\localsourcesafe\akelahrenterpr ise\akela.webframework\design\treeview\treenode.cs :451
Akela.WebFramework.Design.TreeView.TreeNode.get_Us erControl() in
d:\projects\akelahr\localsourcesafe\akelahrenterpr ise\akela.webframework\design\treeview\treenode.cs :417
Akela.WebFramework.Design.TreeView.TreeNode.TrackV iewState() in
d:\projects\akelahr\localsourcesafe\akelahrenterpr ise\akela.webframework\design\treeview\treenode.cs :1319

Akela.WebFramework.Design.TreeView.BaseChildNode.S ystem.Web.UI.IStateManager.TrackViewState()
in
d:\projects\akelahr\localsourcesafe\akelahrenterpr ise\akela.webframework\design\treeview\basechildno de.cs:255

Akela.WebFramework.Design.TreeView.BaseChildNodeCo llection.System.Web.UI.IStateManager.TrackViewStat e()
in
D:\Projects\AkelaHR\LocalSourceSafe\AkelaHREnterpr ise\Akela.WebFramework\Design\TreeView\BaseChildNo deCollection.cs:472
Akela.WebFramework.Design.TreeView.TreeNode.TrackV iewState() in
d:\projects\akelahr\localsourcesafe\akelahrenterpr ise\akela.webframework\design\treeview\treenode.cs :1318

Akela.WebFramework.Design.TreeView.BaseChildNode.S ystem.Web.UI.IStateManager.TrackViewState()
in
d:\projects\akelahr\localsourcesafe\akelahrenterpr ise\akela.webframework\design\treeview\basechildno de.cs:255

Akela.WebFramework.Design.TreeView.BaseChildNodeCo llection.System.Web.UI.IStateManager.TrackViewStat e()
in
D:\Projects\AkelaHR\LocalSourceSafe\AkelaHREnterpr ise\Akela.WebFramework\Design\TreeView\BaseChildNo deCollection.cs:472

Akela.WebFramework.Design.TreeView.BaseChildNodeCo llection.SetViewStateDirty()
in
D:\Projects\AkelaHR\LocalSourceSafe\AkelaHREnterpr ise\Akela.WebFramework\Design\TreeView\BaseChildNo deCollection.cs:206

Akela.WebFramework.Design.TreeView.TreeView.CopyXm lNodesIntoTree(TreeNodeCollection
col, Object dest) in
d:\projects\akelahr\localsourcesafe\akelahrenterpr ise\akela.webframework\design\treeview\treeview.cs :1462
Akela.WebFramework.Design.TreeView.TreeView.ReadTr eeNodeXmlSrc() in
d:\projects\akelahr\localsourcesafe\akelahrenterpr ise\akela.webframework\design\treeview\treeview.cs :1437
Akela.WebFramework.Design.TreeView.TreeView.OnInit (EventArgs e) in
d:\projects\akelahr\localsourcesafe\akelahrenterpr ise\akela.webframework\design\treeview\treeview.cs :851
System.Web.UI.Control.InitRecursive(Control namingContainer)
System.Web.UI.Control.InitRecursive(Control namingContainer)
System.Web.UI.Control.InitRecursive(Control namingContainer)
System.Web.UI.Page.ProcessRequestMain()
Can anyone give a hint?

Thanks in advance,
Alex
Nov 18 '05 #1
1 2859
"Alexandru Nedelcu" <al**@noemail.com> wrote in message
news:ub**************@TK2MSFTNGP10.phx.gbl...
Hi!!!

I'm trying to add a UserControl created using the
Page.LoadCotnrol("test.ascx") method to a Page's Control collection and
the exception I get is ( the complete stack trace):

[HttpException (0x80004005): A control cannot modify its parents'
control collections.] ....
Can anyone give a hint?


Yes. "Don't _do_ that!"

:-)

Add the user control to the Controls collection of the control whose event
you're handling.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Duncan Mole | last post: by
5 posts views Thread by Marcel Gelijk | last post: by
7 posts views Thread by Sky | last post: by
1 post views Thread by Jeff Evans | last post: by
6 posts views Thread by Francois | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.