Upgrades Questions on upgrading to version 7.x.
Version 7.x > Upgrades > Error on live website after upgrade from 6. View modes: 
User avatar
Member
Member
Brandon - 11/7/2012 3:10:02 PM
   
Error on live website after upgrade from 6.
After sorting through errors from the upgrades to the API I can get our website to build and can reach the CMSDesk and CMSSiteManager without any issues. I do get server errors on the live site (or preview).

The error I'm getting is
[CMSPortalManager.DocumentManager]: Current page must implement ICMSPage interface.

Any help sorting this out would be appreciated. I have debugging enabled in my web.config but it doesn't break when debugging for some reason. I just get this error on the page.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/8/2012 5:05:41 AM
   
RE:Error on live website after upgrade from 6.
Hi,

I guess you are using ASPX templates - does your template inherit from the TemplatePage class as it is in the documentation for ASPX page templates?

Best regards,
Juraj Ondrus

User avatar
Member
Member
Brandon - 11/8/2012 7:05:08 AM
   
RE:Error on live website after upgrade from 6.
Juraj, Thank you for the response. You guesses correctly and upon changing that I got past that error, but immediately encountered another.

Now I'm getting "The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases."

Any guesses?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/8/2012 7:19:51 AM
   
RE:Error on live website after upgrade from 6.
Hi,

There were some changes in the controls life cycle since version 5, please see this KB article and also this thread.

Best regards,
Juraj Ondrus

User avatar
Member
Member
Brandon - 11/8/2012 8:17:33 AM
   
RE:Error on live website after upgrade from 6.
Juraj,

I'm actually updating from v6 (6.0.25(SP1)) to v7. The KB article that you linked to seems to be from 5 to 6. I did look it over anyways though. It seems from my reading that I can't use any ASP tags in web parts? This is troubling because we use ASP tags throughout much of our page templates and web parts. Is there some setting that can be changed within the CMSDesk or CMSSiteManager that can allow for these ASP tags?

Also regarding the thread you linked to, I also attempting moving around my CMSPortalManager & ajaxToolkit tags without any success.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/8/2012 8:23:33 AM
   
RE:Error on live website after upgrade from 6.
Hi,

That does not matter whether you are going from 5 or 6 version. To ensure the development models, the life cycle had to be changed - also, if it worked in versions 4, 5, 6 - it was working by mistake/luck.

Regrettably, there is no setting to enable this since it will break the core engine. you need to use the workaround mentioned in the KB article.

I am sorry for this inconvenience.

Best regards,
Juraj Ondrus

User avatar
Member
Member
Brandon - 11/8/2012 8:26:19 AM
   
RE:Error on live website after upgrade from 6.
Juraj, thank you for the quick responses.

What types of files are ASP code blocks not allowed? Can they still be used on Page Templates and just not Web Parts?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/8/2012 9:25:31 AM
   
RE:Error on live website after upgrade from 6.
Hi,

Ususally the <% %> blocks cannot be used in either a web part or page template layout.

Best regards,
Juraj Ondrus

User avatar
Member
Member
Brandon - 11/12/2012 1:25:08 PM
   
RE:Error on live website after upgrade from 6.
I ended up getting our website to run on Kentico v7 without getting this error. It ended up being runable so long as I didn't go into the CMSDesk. If I'm not logged into the CMS, the website will run and I can login from the website and I can even use the onsite editing feature added with v7. All of this is with ASP code blocks on several pages. Once I attempt to enter the CMSDesk however, I get the same error
The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.

The stack trace looks like this:
[HttpException (0x80004005): The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.]
System.Web.UI.ControlCollection.Add(Control child) +9601391
CMS.UIControls.ContentPage.EnsureScriptManager() +302
CMS.ExtendedControls.ControlsHelper.EnsureScriptManager(Page page) +77
CMS.ExtendedControls.CMSUpdatePanel.OnInit(EventArgs e) +71
System.Web.UI.Control.InitRecursive(Control namingContainer) +134
System.Web.UI.Control.InitRecursive(Control namingContainer) +290
System.Web.UI.Control.InitRecursive(Control namingContainer) +290
System.Web.UI.Control.InitRecursive(Control namingContainer) +290
System.Web.UI.Control.InitRecursive(Control namingContainer) +290
System.Web.UI.Control.AddedControl(Control control, Int32 index) +191
System.Web.UI.ControlCollection.Add(Control child) +86
CMS.PortalControls.CMSPortalManager.CreateEditMenu(PageInfo pi, Boolean isPreview, ViewModeEnum viewMode) +677
CMS.PortalControls.CMSPortalManager.CreateChildControls() +660
System.Web.UI.Control.EnsureChildControls() +83
CMS.PortalControls.CMSPortalManager.CMSPortalManager_Init(Object sender, EventArgs e) +416
System.Web.UI.Control.OnInit(EventArgs e) +92
CMS.ExtendedControls.CMSWebControl.OnInit(EventArgs e) +44
System.Web.UI.Control.InitRecursive(Control namingContainer) +134
System.Web.UI.Control.InitRecursive(Control namingContainer) +290
System.Web.UI.Control.InitRecursive(Control namingContainer) +290
System.Web.UI.Control.InitRecursive(Control namingContainer) +290
System.Web.UI.Control.InitRecursive(Control namingContainer) +290
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +489

I also removed all ASP code blocks from the master & home templates in order to try and get this to run without error embedded in the CMSDesk and I have had no success. Even using only asp:Literals to manipulate the code via codebehind, I'm given this error after visiting the CMSDesk.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/13/2012 1:35:23 AM
   
RE:Error on live website after upgrade from 6.
Hi,

What is the code of your page templates? Are you using ASPX or mixed mode page templates? Are you able to reproduce the issue on a fresh Kentico CMS installation?

Best regards,
Juraj Ondrus

User avatar
Member
Member
Brandon - 11/13/2012 7:42:21 AM
   
RE:Error on live website after upgrade from 6.
We're using ASPX templates. We don't have a template setup for our Master page, it's just included at the top of each template. I'm attempting a fresh install of v7 right now so that I can try to reproduce the problem. Do you want me to post the complete code for my master page and home page here?

User avatar
Member
Member
Brandon - 11/13/2012 9:14:45 AM
   
RE:Error on live website after upgrade from 6.
After doing a clean install of Kentico v7 and reviewing differences, I was able to get this working. It seems to have nothing to do with ASP code blocks or running code in Page_Load vs PreRender. All I had to do was switch the "ToolkitScriptManager" to be above the "CMSPortalManager" rather than below it.

This didn't work:
<asp:PlaceHolder runat="server" ID="TopPlaceHolder">
<cms:CMSPortalManager ID="manPortal" runat="server" EnableViewState="false" />
<ajaxToolkit:ToolkitScriptManager ID="manScript" runat="server" EnableViewState="false" ScriptMode="Release" EnablePageMethods="true" />
</asp:PlaceHolder>

This works:
<asp:PlaceHolder runat="server" ID="TopPlaceHolder">
<ajaxToolkit:ToolkitScriptManager ID="manScript" runat="server" EnableViewState="false" ScriptMode="Release" EnablePageMethods="true" />
<cms:CMSPortalManager ID="manPortal" runat="server" EnableViewState="false" />
</asp:PlaceHolder>

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/14/2012 1:56:48 AM
   
RE:Error on live website after upgrade from 6.
Hi Brandon,

This is exactly what is said in the forum thread I linked in one of my first posts in this thread.

Anyway - this behavior is weird and there is definitely something odd going on. I have already noticed our developers about this to inspect this issue. This should not have happened and the order of those controls should not be significant.

We are sorry for this inconvenience.

Best regards,
Juraj Ondrus

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/14/2012 2:26:15 AM
   
RE:Error on live website after upgrade from 6.
Hi again,

I think I have found a workaround for now - could you pelase try adding the
<cms:ContextMenuPlaceHolder ID="plcCtx" runat="server" />
control on the master page? This should work for now. Our developers are working on this issue and I hope it will be fixed soon.

Best regards,
Juraj Ondrus

User avatar
Member
Member
ammad-wirestorm - 2/28/2014 7:44:59 AM
   
RE:Error on live website after upgrade from 7.
Same thing happening in my project. I have upgraded to Kentico 7.
Could you please help ?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/2/2014 1:16:26 AM
   
RE:Error on live website after upgrade from 7.
Hi,

All the above applies for v7 as well. Make sure your master page template looks like this:

...<form id="form1" runat="server">
<asp:PlaceHolder runat="server" ID="plcManagers">
<ajaxToolkit:ToolkitScriptManager ID="manScript" runat="server" EnableViewState="false"
ScriptMode="Release" />
<cms:CMSPortalManager ID="manPortal" runat="server" EnableViewState="false" />
</asp:PlaceHolder>
<cms:ContextMenuPlaceHolder ID="plcCtx" runat="server" />...


Best regards,
Juraj Ondrus