473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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 2947
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
0
by: Duncan Mole | last post by:
Hi, I have created a control which draws a title bar and provides a drop down menu for a Smart Device Application. It seemed to work fine until I came to add an event handler to act on Paint...
0
by: adam | last post by:
i have custom user control and i'm trying to pass values to custom user control......I need help it seems to me i cannot pass the value to user control from dropdownlist. I have property in a...
5
by: Marcel Gelijk | last post by:
Hi, I am trying to create a User Control that is located in a seperate class library. The User Control contains a textbox and a button. The page generates an exception when it tries to access...
7
by: Sky | last post by:
What I have currently: I have a user control called mod_container.aspx that is basically two divs -- the top a toolbar, that expands/collapse the second div which can contain other...
1
by: Jeff Evans | last post by:
Hi, I was wondering if it's possible to remove a Control c from a Controls collection in the parent's event handler for an event fired by c. For instance let's say we have public class...
6
by: Francois | last post by:
Hi, I am trying to implement a custom control that extends the standard System.Web.UI.WebControls.CheckBox control. In the .Net class library reference it is said that CheckBox Implements...
1
by: Dan Sikorsky | last post by:
I'm getting the following message when I try to add a CustomValidator control to the ValidationSummary to display an error message at runtime, and displaying ex.message in AddValidationControl...
0
by: ChopStickr | last post by:
I have a custom control that is embedded (using the object tag) in an html document. The control takes a path to a local client ini file. Reads the file. Executes the program specified in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.