YSOD: URL Picker inside DataType Grid



I recently upgraded to uComponents v5.5.1 on umbraco v4.11.8 and now get the following exception from pages with my DataType Grid added:
The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.

[HttpException (0x80004005): The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.]
   System.Web.UI.ControlCollection.Add(Control child) +9600379
   umbraco.editorControls.ResourceExtensions.RegisterEmbeddedClientResource(Page page, Type resourceContainer, String resourceName, ClientDependencyType type) +279
   uComponents.DataTypes.UrlPicker.UrlPickerDataEditor.OnLoad(EventArgs e) +51
   System.Web.UI.Control.LoadRecursive() +54
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +260
   System.Web.UI.ControlCollection.Add(Control child) +86
   uComponents.DataTypes.DataTypeGrid.DataEditor.CreateChildControls() +1385
   System.Web.UI.Control.EnsureChildControls() +83
   System.Web.UI.WebControls.CompositeControl.get_Controls() +15
   ClientDependency.Core.ControlExtensions.FlattenChildren(Control control) +12
   System.Linq.<SelectManyIterator>d__14`2.MoveNext() +234
   System.Linq.<ConcatIterator>d__71`1.MoveNext() +293
I've got a pretty complex DataType Grid with images, text and URL pickers in. It seems if I remove the URL picker from the grid then it stops the exceptions happening... but I really need the URL picker in there!

Any suggestions for a workaround/fix?


Closed Sep 26, 2013 at 5:50 PM by Azzlack
Fixed in release 8606c04e2874


SC_WebTeam wrote Sep 11, 2013 at 1:07 PM

We've also got this issue with v5.5.0 & v5.5.1 on a few versions of Umbraco (4.11.10, 6.1.3 & 6.1.4)
Again, this only occurs when we add a URL Picker to a DataType Grid.

diachedelic wrote Sep 11, 2013 at 5:45 PM

Wow I didn't know the URL picker could be used in a DTG...

I have no idea why this is happening, perhaps you can supply a longer stack trace?

Azzlack wrote Sep 11, 2013 at 8:37 PM

Fixed in commit #1a47cea85008

** Closed by Azzlack 09/11/2013 12:37PM

narhangelov wrote Sep 16, 2013 at 1:20 PM


I also reproduce it in Umbraco v6.1.3 and uComponents 5.5.1

I created a new bug - https://ucomponents.codeplex.com/workitem/14870

Azzlack wrote Sep 16, 2013 at 4:11 PM

Can you try installing version 5.5.2-build010 and see if it solves your problem?

Run the following commands in your Package Manager Console:

Install-Package DiscoverPackageSources
DiscoverPackageSources -Url "https://www.myget.org/F/ucomponents/"
Install-Package uComponents -Version 5.5.1-build010

bfi wrote Oct 1, 2013 at 9:13 AM

I have 5.5.2 uComponents from NuGet in Umbraco 6.1.5 and still get this error.

bfi wrote Oct 1, 2013 at 9:29 AM

My bad, I upgraded from 5.5.1 to 5.5.2 but the assemblies weren't overwritten before I tested. The error is fixed.