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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dan

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

    Hi,

    I get this error:
    "Controls collection cannot be modified because the control contains code
    blocks (i.e. <% ... %>). "
    when trying to create a table in the code-behind file like this:
    dim t as table
    t = New Table()
    Page.Controls.A dd(t)
    while the aspx file contains this:
    <body>
    amount of records: <%=rec%>
    <form id="form1" runat="server">
    </form>
    </body>

    My question is: why is it not possible to create e.g. a table in an aspx
    file when there is somewhere code blocks?

    Thanks
    Dan


Working...