I'm trying out migration of our website from EPiServer 4.62 to EPiServer 5, using the technical notes and help through forum. After migration and code fix, I was able to login to the edit mode. But when i try to load an existing page in "View" mode, i get the an error as copied below. I couldn't debug as well.
Can you please let me know if i am missing anything:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).] System.Web.UI.ControlCollection.Add(Control child) +8680983 EPiServer.RightClickMenu.Render(Boolean waitForOnLoad) +1583 EPiServer.RightClickMenu.Render() +33 EPiServer.Web.PageExtensions.ContextMenu.RenderMenuScripts(Object sender, EventArgs e) +621 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Control.OnPreRender(EventArgs e) +8686422 System.Web.UI.Control.PreRenderRecursiveInternal() +80 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
It's exactly what the error says, your page contains code blocks which prevents EPiServer from injecting the right click menu code.
You can easily solve this, either by rewriting your code to use controls instead of codeblocks somehow, or simply move the code blocks into a user control and load that control into the page.