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

D

Dan

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.Add(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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top