473,395 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
May 27 '06 #1
0 1329

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeff Dockman | last post by:
Background: We needed the ability to create a templated web site that may change in layout from installation to installation. To accomplish this, we created a base Page class that all pages in...
5
by: Jeremy Ames | last post by:
I have run into a major road block with my page development projects. I am trying to add a literal control to my asp.net page and I got an error stating that the control could not be added because...
3
by: Hadar | last post by:
Hi, I'm trying to dynamically set the src of an iframe with the <% %> block: <iframe id="content" src="<% = Request.QueryString.Get("content") %>" width="100%"></iframe> Notice that the tag...
2
by: Axel Dahmen | last post by:
HI, I want to dynamically add controls to a web page from within a common base class. Unfortunately, ASP.NET fails with "System.Web.HttpException: The Controls collection cannot be modified...
3
by: thomasamillergoogle | last post by:
Is it possible that my user control can add code to the HEAD of the parent page that hosts the control?
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
0
by: Zimmergren | last post by:
I know this has been up on googlegroups before, on several places. However, I havn't found a solution to this specific problem. I get this errormessage: "The Controls collection cannot be...
2
by: CyberSoftHari | last post by:
I am adding dynamic controls in my page through a panel as figured below. pnlModel.ID = "pnlDyModel"; pnlModel.Controls.Add(lblReportTitle); pnlModel.Controls.Add(new...
1
by: Radu | last post by:
Hi. I am trying to localize a page AND simulate the AJAX watermarks in it, i.e. the textbox contains the text "Enter your name", or "Entrez votre nom", for instance, then on click, delete this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.