Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Controls collection cannot be modified because control contains code blocks (i.e. <% ... %>).

Reply
Thread Tools

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

 
 
Dan
Guest
Posts: n/a
 
      05-27-2006
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Controls collection cannot be modified because the controlcontains code blocks Radu ASP .Net 1 04-16-2008 02:59 PM
Collection problems (create Collection object, add data to collection, bind collection to datagrid) Řyvind Isaksen ASP .Net 1 05-18-2007 09:24 AM
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). Zimmergren ASP .Net 0 06-16-2006 03:29 PM
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>) Hadar ASP .Net 3 09-07-2004 01:09 PM
procs/blocks - blocks with procs, blocks with blocks? matt Ruby 1 08-06-2004 01:33 AM



Advertisments