Upgrades Questions on upgrading to version 7.x.
Version 7.x > Upgrades > Error in CMS desk after applying latest hotfix 7.0.14 View modes: 
User avatar
Member
Member
andrewjknox - 1/10/2013 3:35:40 AM
   
Error in CMS desk after applying latest hotfix 7.0.14
Hi there,

I applied the latest hotfix v7.0.14 onto my v7.0.1 installation to fix viewstate errors I was having editing doc type fields (which is now working) but I'm now getting the error below in the "Page" tab on the CMSDesk where pages use my templates.

I'm using ASPX only. I'm using the CMSPageManager and not portal. I've seen a couple of other posts related to this but hasn't seem to have resolved my problem.
Description: Message: The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.
Stack Trace:
at System.Web.UI.ControlCollection.Add(Control child)
at CMS.UIControls.ContentPage.EnsureScriptManager()
at CMS.ExtendedControls.ControlsHelper.EnsureScriptManager(Page page)
at CMS.ExtendedControls.CMSUpdatePanel.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at CMS.Controls.CMSPageManager.CreateEditMenu(PageInfo pi, Boolean isPreview, ViewModeEnum viewMode)
at CMS.Controls.CMSPageManager.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Site name: [XXX]
Machine name: XXX-VM
Event URL: /cms/getdoc/04ca58d5-4721-47e2-8067-a2e85abe19f3/default.aspx?viewmode=3&lang=en-GB&langobjectlifetime=request
URL referrer: http://dev.[XXX].com/CMSModules/Content/CMSDesk/Edit/edittabs.aspx?mode=edit&nodeid=1&culture=en-GB
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11

Is this something you guys are aware of? I've applied the same hotfix onto the corporate site install using the same version and nothing seemed to break in the same area.

Regards,
Andrew

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 1/15/2013 5:48:37 AM
   
RE:Error in CMS desk after applying latest hotfix 7.0.14
So, we have solved this issue with Andrew over tickets...

There are 2 generally options to solve this:

1. Replace CMSPageManager with CMSPortalManager and you also need to put the Ajax Control Kit on the page as you can see in the Developers Guide - Creating ASPX master pages.

2. Place this line:
<asp:ScriptManager ID="manScript" runat="server" />
right after the:
<cms:CMSPageManager ID="cmsPageManager" runat="server" EnableViewState="false" />

so it will be:
<cms:CMSPageManager ID="cmsPageManager" runat="server" EnableViewState="false" />
<asp:ScriptManager ID="manScript" runat="server" />

I have found this in the old documentation for v5.5R2.

Best regards,
Martin Danko

User avatar
Member
Member
andrewjknox - 1/31/2013 5:35:42 AM
   
RE:Error in CMS desk after applying latest hotfix 7.0.14
Thanks Martin. I managed to get around this issue (as I didn't want the ScriptManager control on the live site because of the additional payload) by doing the following:

On master (I needed to have the outer placeholder "plcManagers"):

<asp:PlaceHolder runat="server" ID="plcManagers">
<cms:CMSPageManager ID="cmsPageManager" runat="server" EnableViewState="false" />
<asp:PlaceHolder runat="server" ID="phScriptManager" />
</asp:PlaceHolder>

On a template code-behind:
private void CreateScriptManager()
{
if (CMSContext.ViewMode == ViewModeEnum.Edit)
{
var script = new ScriptManager();
script.ID = "ScriptManager1";
this.FindControl("Form").FindControl("plcManagers").FindControl("phScriptManager").Controls.Add(script);
}
}

That way, only the "Page" tab in the CMS uses this functionality, keeping the public facing side of it lighter in terms of payload size.

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 1/31/2013 9:52:47 AM
   
RE:Error in CMS desk after applying latest hotfix 7.0.14
Hi Andrew,

Thanks for the update with the example. So as I suppose, everything is working fine now, right?

Best regards,
Martin Danko