For the past couple of hours I have been banging my head and pulling my left over few strands of hair to figure out what’s wrong with my code causing the below exception.
The Controls collection cannot be modified because the control contains code blocks (i.e. < % ... %>)
I finally found out the solution from a least expected settings.
The Controls collection cannot be modified because the control contains code blocks
I was trying to integrate our project demo into the Ektron CMS 400.NET along with Telerik (initially I had whole set of issues). Once I added all our code & web pages into the Ektron, our pages look great and Ektron “Work Area” is NOT working. when ever I access the work area, I get the above error. I started digging deep, but long story short, the culprit seems to be .NET Theme.
Our websites uses themes and configured at web.config “pages” section level. WorkArea web pages does NOT have any themes defined. So, I reset the themes in WorkArea/Web.Config file and all is working fine.
Web.Config Theme Differences