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

Discussion in 'ASP .Net' started by Dan, May 27, 2006.

  1. Dan

    Dan Guest


    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()
    while the aspx file contains this:
    amount of records: <%=rec%>
    <form id="form1" runat="server">

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

    Dan, May 27, 2006
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page