Today I fired up the canvas editor for one of the pages in a new site I'm working on, only to be met with:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Hmmf. It's because in the footer of the website I'm doing:
<%=DateTime.Now.Year%>
To output the current year. Umbraco is attempting to modify the controls collection of the page to create the editor, which is not allowed when using inline code blocks.
The workaround is a bit sneaky, but simple. All you need to do is change to the databinding syntax for echoing, like this:
<%# DateTime.Now.Year %>
Now all is well, the control collection can be modified and you can bask in the glory of the Umbraco canvas editor.
No comments:
Post a Comment