Once after adding RichTextEditor.dll in my project, giving error like "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). "

Dec 13, 2010 at 1:12 PM

  Once after adding RichTextEditor.dll in my project, and run the project its giving error like shown below.

Server Error in '/NULINKPL' Application.

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

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 Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Source Error:

Line 187:
Line 188:            cssLink.Href = Global.Instance.Resource.GetUrl(this.Page, "AjaxControls.Toolbar.css");
Line 189:            this.Page.Header.Controls.Add(cssLink);
Line 190:
Line 191:            Global.Instance.Resource.RegisterClientScript(this.Page, this.Controls, "AjaxControls.Microsoft.js");


Source File: D:\Pradeep Anandachari\temp code\Rich Text Editor\rte-57274\RichTextEditor\ToolBar.cs    Line: 189

Stack Trace:

[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
   System.Web.UI.ControlCollection.Add(Control child) +8680855
   AjaxControls.ToolBar.OnPreRender(EventArgs e) in D:\Pradeep Anandachari\temp code\Rich Text Editor\rte-57274\RichTextEditor\ToolBar.cs:189
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842


this error is giving in below part of the code in the file "ToolBar.cs"