RadDockZone in RadWindow throws error

4 posts, 0 answers
  1. Jason
    Jason avatar
    26 posts
    Member since:
    May 2008

    Posted 07 Oct 2009 Link to this post

    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>

     

  2. Jason
    Jason avatar
    26 posts
    Member since:
    May 2008

    Posted 07 Oct 2009 Link to this post

    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

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 08 Oct 2009 Link to this post

    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.
  5. Jason
    Jason avatar
    26 posts
    Member since:
    May 2008

    Posted 14 Oct 2009 Link to this post

    Thats was it, thanks!!
Back to Top