I am attempting to convert some comment text boxes into rich text boxes. However when I do this I am getting the following error:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Description: An
unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
The 2nd comment in this thread mentions issues with the <% %> tags. I have isolated the issue to the way we are using these tags on our master page. We are using <%= %> tags for our js files, css and image tags. I attempted to convert them to <%# %> but that only fails to load our js, css, and images.
for example:
<script src="<%= ResolveUrl("~/Scripts/jquery.selectbox-0.2.js") %>" type="text/javascript"></script>
<img id="imgLogo" src="<%= ResolveUrl("~/Images/Accordion/background-1.png") %>" alt="Logo"/>
Are there any other solutions to this problem?