Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Unable to access the design tab in the cmsdesk View modes: 
User avatar
Member
Member
bubriski-gmail - 5/28/2009 8:21:41 AM
   
Unable to access the design tab in the cmsdesk
When trying to view the design tab on any page, I get:

"System Error

An error occured processing your request at URL /CMSPages/PortalTemplate.aspx.

Click here to go back to the home page"

Any idea how to fix it? I don't think I did anything to make this happen. Thanks in advance!

User avatar
Member
Member
bubriski-gmail - 5/28/2009 8:22:46 AM
   
RE:Unable to access the design tab in the cmsdesk
Actually, it only seems to happen on the root node...

User avatar
Member
Member
bubriski-gmail - 5/28/2009 10:35:04 AM
   
RE:Unable to access the design tab in the cmsdesk
I checked my staging site with exceptions shown and found that I get:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Any idea why this would happen?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 5/29/2009 9:17:53 AM
   
RE:Unable to access the design tab in the cmsdesk
Hello.

Could you please check code of appropriate page for any <%...% > blocks? Because of the system uses dynamic control creation which disallows direct <% %> code block in your code. You need to remove this kind of code blocks from your code and replace them with the code that does not affect the page controls collection.

Best Regards,
Radek Macalik

User avatar
Certified Developer v7
Certified  Developer v7
matt.wojas-gmail - 3/14/2012 9:36:26 AM
   
RE:Unable to access the design tab in the cmsdesk
Can you provide an example of "code that does not affect the page controls collection"?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/15/2012 2:58:07 AM
   
RE:Unable to access the design tab in the cmsdesk
Hi,

You need to use following approach instead:
<asp:Literal runat="server" ID="test" Text="test" />

<script runat="server">
protected void Page_PreRender(object sender, EventArgs e)
{
test.Text = CMS.GlobalHelper.ResHelper.GetString("general.ok");
}
</script>

Best regards,
Juraj Ondrus

User avatar
Member
Member
Bev - 4/10/2012 9:50:21 AM
   
RE:Unable to access the design tab in the cmsdesk
Hi there,

I have just started using Kentico and ASP.Net so apologies for what is probably a simple question.

I have the issue above where I am unable to view the design tab for the Master Page, and looking at the Master Page it does indeed have some code contained within <% ... %>

However I'm not entirely too sure how I should be amending the code to use the correct approach.

The current code I have is:
<div id="wrapper" class="<%=CMS.CMSHelper.CMSContext.CurrentDocument.DocumentName == "Home"?"index-body":"inner-body"%>">

If someone can explain how I should amend it, I would be very grateful.

Thanks,
Bev

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 4/11/2012 5:59:04 AM
   
RE:Unable to access the design tab in the cmsdesk
Hi,

You will just use the code above with the Literal tag. In the text of the literal you will put the complete DIV tag syntax with the current document name, something like this:
<asp:Literal runat="server" ID="test" Text="test" />

<script runat="server">
protected void Page_PreRender(object sender, EventArgs e)
{
test.Text = "<div id=\"wrapper class=\"" + CMS.CMSHelper.CMSContext.CurrentDocument.DocumentName + ">";
}
</script>

Best regards,
Juraj Ondrus

User avatar
Certified Developer v7
Certified  Developer v7
ianwright - 11/12/2013 7:49:42 AM
   
RE:Unable to access the design tab in the cmsdesk
Alternatively you can change how you how you evaluate your expressions slightly by using data-binding - see my blog post http://wrightdev.wordpress.com/2013/11/12/kentico-inline-data-binding/