This is a migrated thread and some comments may be shown as answers.

RadDockZone in RadWindow throws error

3 Answers 40 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 07 Oct 2009, 05:24 PM
I have a detail page that I popup in a rad window and when I go to add a raddock layout and zone I get this error:

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. <% ... %>).

If I take the Dockzone out the page loads properly, here is the code I am using to put the dock on the page:

 

<telerik:RadDockLayout runat="server" ID="RadDockLayout1" EnableEmbeddedSkins="false"

 

 

Skin="None" OnSaveDockLayout="RadDockLayout1_SaveDockLayout" OnLoadDockLayout="RadDockLayout1_LoadDockLayout">

 

 

<telerik:RadDockZone runat="server" ID="RadDockZone1" Orientation="vertical" Style="border: 0px;

 

 

width: 100%;">

 

 

<telerik:RadDock runat="server" ID="RadDockBio" Title="Bio Line" EnableAnimation="true"

 

 

AutoPostBack="true" CommandsAutoPostBack="true">

 

 

<ContentTemplate>

 

 

</ContentTemplate>

 

 

</telerik:RadDock>

 

 

</telerik:RadDockZone>

 

 

</telerik:RadDockLayout>

 

3 Answers, 1 is accepted

Sort by
0
Jason
Top achievements
Rank 1
answered on 07 Oct 2009, 05:32 PM
Here is the 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) +8678903
   Telerik.Web.SkinRegistrar.RegisterCssReference(Page _page, Control _control, String _url) +371

[HttpException (0x80004005): Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error.]
   Telerik.Web.SkinRegistrar.RegisterCssReference(Page _page, Control _control, String _url) +436
   Telerik.Web.SkinRegistrar.RegisterCssReferences(ISkinnableControl _control) +818
   Telerik.Web.UI.RadWebControl.RegisterCssReferences() +101
   Telerik.Web.UI.RadWebControl.ControlPreRender() +79
   Telerik.Web.UI.RadWebControl.OnPreRender(EventArgs e) +47
   Telerik.Web.UI.RadDockZone.OnPreRender(EventArgs e) +221
   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

0
Pero
Telerik team
answered on 08 Oct 2009, 02:11 PM
Hi Jason,

From the code you have provided I cannot really see what might be causing the problem. If you have client script on the page please try wrapping the <script> tags with <telerik:RadScriptBlock> control as shown below:

<telerik:RadScriptBlock ID="ScriptBlock1" runat="server">
 
    <script type="text/javascript">
        function DoSomething()
        {
            var dock = $find("<%=RadDock1.ClientID %>");
        }
    </script>
 
</telerik:RadScriptBlock>


If this does not help please send us a running problem where we can observe the problem. Also, detailed reproduction steps will be helpful.


Sincerely yours,
Pero
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jason
Top achievements
Rank 1
answered on 14 Oct 2009, 07:02 PM
Thats was it, thanks!!
Tags
Dock
Asked by
Jason
Top achievements
Rank 1
Answers by
Jason
Top achievements
Rank 1
Pero
Telerik team
Share this question
or