We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

DiagramWebControl The control collection cannot be modified ...

Hello.

I have problem to add new page with DiagramWebControl to existing website.

When I trying to load page with diagram I get following error:

Server Error in '/' Application.

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.

Source Error:

[No relevant source lines]


Source File:c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b894f2a9\fbf83466\App_Web_a30c4m1s.0.cs Line:0

Stack Trace:

[HttpException (0x80004005): The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.] System.Web.UI.ControlCollection.RemoveAt(Int32 index) +9598151 System.Web.UI.ControlCollection.Clear() +40 Syncfusion.Web.UI.WebControls.Diagram.DiagramWebControl.OnUnload(EventArgs e) +646 System.Web.UI.Control.UnloadRecursive(Boolean dispose) +237 System.Web.UI.Control.UnloadRecursive(Boolean dispose) +173 System.Web.UI.Control.UnloadRecursive(Boolean dispose) +173 System.Web.UI.Page.UnloadRecursive(Boolean dispose) +23 System.Web.UI.Page.ProcessRequestCleanup() +56 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +245 System.Web.UI.Page.ProcessRequest() +72 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21 System.Web.UI.Page.ProcessRequest(HttpContext context) +58 ASP.orgchart_userorgcharttest_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b894f2a9\fbf83466\App_Web_a30c4m1s.0.cs:0 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69



Version Information:Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18033

I have tried to change application pools from integrated to classic.

When I create new web site with diagram control - everything ok.

Following aspx and cs files:

<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="UserOrgChartTest.aspx.cs"Inherits="OrgChart_UserOrgChart"%>

<%@Registerassembly="Syncfusion.Diagram.Web, Version=11.104.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"namespace="Syncfusion.Web.UI.WebControls.Diagram"tagprefix="syncfusion"%>

<!DOCTYPEhtml>

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title></title>

</head>

<body>

<formid="form1"runat="server">

<syncfusion:DiagramWebControlID="DiagramWebControl2"runat="server"Height="500px"Width="600px"/>

</form>

</body>

</html>

///////////////////////////////////////////////////

usingSystem;

usingSystem.Collections.Generic;

usingSystem.Web;

usingSystem.Web.UI;

usingSystem.Web.UI.WebControls;

publicpartialclassOrgChart_UserOrgChart: System.Web.UI.Page

{

protectedvoidPage_Load(objectsender,EventArgse)

{

}

}



2 Replies

IM Igor Malkov July 15, 2013 08:53 AM UTC

Hello.

I have found the source of problem.

Need to append

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

Best regards.



AA Amsath Ali M Syncfusion Team July 15, 2013 12:35 PM UTC

Hi Igor,

 

Thanks for using Syncfusion products.

 

We are happy to hear that the issue has been resolved by yourself. Please let us know if you require any further assistance on this.

 

Regards,

Amsath


Loader.
Live Chat Icon For mobile
Up arrow icon