can't create table when <% ...%> is in page
I try to create a table in the code-behind file like this:
dim t as table
t = New Table()
The aspx file contains this:
amount of records: <%=rec%>
<form id="form1" runat="server">
But I get this error:
"Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). "
My question is: why is it not possible to create a table (or anything)in an aspx file when there is somewhere code blocks? Is there a specific reason?