can't create table when <% ...%> is in page
Hi,
I try to create a table in the code-behind file like this:
dim t as table
t = New Table()
Page.Controls.Add(t)
The aspx file contains this:
<body>
amount of records: <%=rec%>
<form id="form1" runat="server">
</form>
</body>
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?
Thanks
|