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