Decrease Font Size
Increase Font Size
   BLOG

The Controls collection cannot be modified because the control contains code blocks

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: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Solution: Check if you have something like <%= %> in the section

<head id="Head1" runat="server">
<script  type="text/javascript" src='<%= ResolveClientUrl("~/js/ddaccordion.js") %>'></script>
<script  type="text/javascript" src='<%= ResolveClientUrl("~/js/jquery-1.2.2.pack.js") %>'></script>

</head>

If you do, move it out from the head section

Comments are closed