Register | Login

ZettaCube Forum and Knowledge Base

Welcome to ZettaCube forum. Here you can discuss various issues regarding our ZeeControls product. If you want to contact our developers directly, please email to support@zettacube.com.

Please register to post a message. Registration is immediate and free. Return users please login here.

 
  Forum  Knowledge Base  Run-Time Issues  The Controls collection cannot be modified because the control contains code blocks
Previous Previous
 
Next Next
New Post 12/11/2008 12:45 PM
  ZettaCube Support
57 posts
No Ranking


The Controls collection cannot be modified because the control contains code blocks 
Modified By ZettaCube Support  on 3/30/2009 11:48:03 PM)

You encountered the following error at run-time:

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

ZeeControls inserts default style sheets to the <head> section of the page. If there is any code block (i.e. <% ... %>) in the <head> section, the above exception will be thrown when the default style sheets are inserted.  Please move the code block outside of the <head> section.

For example, you might want to declare an OnClientPanelResized event handler, and use <%= Panel.ClientID %> to get the panel's ID.  The following declaration will generate the above exception.

<head runat="server">
    <title>My App</title>
    <script type="text/javascript">
    function PanelResizedHandler (panelId, oldWidth, oldHeight, newWidth, newHeight) {
        if (panelId == '<%= TreeviewPanel.ClientID %>') {
            ResizeTreeview(newWidth, newHeight);
        }
    }
    </script>
</head>


The remedy is to move the function declaration to the start of <body> section.
 

 
Previous Previous
 
Next Next
  Forum  Knowledge Base  Run-Time Issues  The Controls collection cannot be modified because the control contains code blocks
Copyright 2009 by ZettaCube Limited