Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cannot modify Controls Collection because control contains Code Blocks.

20 views
Skip to first unread message

Jacob Grass

unread,
Oct 5, 2001, 11:38:23 AM10/5/01
to
I am trying to add a label to an ASP.NET page in the Page_Load event. I
create the control, set the ID, CssClass and Text and then call
Me.Controls.Add(myLabel). I receive an error stating that the control
collection could not be modified because the control contains code blocks
(i.e. <%...%>). Has anyone encountered this error before? Anyone know how
to get around it? Furthermore, why is my control being interpreted as
having CodeBlocks? I have also tried adding the Label to a table and adding
the table with the same results.

Thanks in advance

Jacob


Jacob Grass

unread,
Oct 5, 2001, 12:25:31 PM10/5/01
to
Well, I discovered the error was caused by the fact that I had a link object
in the Header of my page with an href enclosed in <% %> tags. . .Removing
that allowed me to add the controls just fine. . .

Jacob

"Jacob Grass" <JGr...@AbilitiSolutions.com> wrote in message
news:erziVNbTBHA.380@tkmsftngp03...

0 new messages