13

My page contains a single component presentation using a component template with output format "ASCX WebControl", being published as a dynamic component presentation and with the "Allow on Page Using Dynamic Assembly" box checked. The component presentation is being published to the content broker database.

After publishing the page I view the rendered file in a text editor, I notice:

    <div><tridion:ComponentPresentation runat="server" PageURI="tcm:8-82-64" ComponentURI="tcm:8-80" TemplateURI="tcm:8-89-32"/></div>

When viewed in a web browser I see:

"CPAssembler error: Web control file is not located inside your website"

I have checked my license file, my jars, dlls and config files and all seem to be in order when compared to another working example.

The application is a .net 3.5 app and the web.config contains:

   <system.web>
      <pages>
        <controls>
          <add tagPrefix="tridion" namespace="Tridion.ContentDelivery.Web.UI" assembly="Tridion.ContentDelivery" />
 <add tagPrefix="smarttarget" namespace="Tridion.SmartTarget.Web.UI" assembly="Tridion.SmartTarget"/>
        </controls>
      </pages>
    <httpModules>
       <add type="Tridion.ContentDelivery.Web.WAI.WAIModule, Tridion.ContentDelivery" name="TridionWAIHttpModule" /> 
    </httpModules>

    <compilation defaultLanguage="c#" debug="true" />

. . .
</system.web>
<system.webServer>
    . . .
    <modules>
        <add name="TridionWAIHttpModule" type="Tridion.ContentDelivery.Web.WAI.WAIModule, Tridion.ContentDelivery" preCondition="managedHandler" />
    </modules>
   . . .
</system.webServer>

Does anyone have an idea of the cause of this error?

3 Answers 3

11

Check your storage configuration (cd_storage_conf.xml or cd_broker_conf.xml for older systems), specifically the storage location for ComponentPresentation items with item extension ".ascx"

You need to ensure that you are publishing your ASCX web controls to the file system and to somewhere within your web application in order that .Net will execute them.

For example:

<Item typeMapping="ComponentPresentation" itemExtension=".Ascx"
storageId="defaultDataFile"/>
10

By changing the settings in cd_storage_conf.xml so that the default storage area my local file store I found an ascx file corresponding to my component presentation. Once this was present my page was correctly rendered.

                <Storage Type="filesystem" Class="com.tridion.storage.filesystem.FSDAOFactory" Id="defaultFile" defaultFilesystem="false">
            <Root Path="C:\inetpub\wwwroot" />
        </Storage>
       <Storage Type="filesystem" Class="com.tridion.storage.filesystem.FSDAOFactory" Id="defaultDataFile" defaultFilesystem="true" defaultStorage="true">
            <Root Path="C:\inetpub\wwwroot\data" />
        </Storage>

        ...

<ItemTypes defaultStorageId="defaultDataFile" cached="false">
    <Item typeMapping="Page" cached="false" storageId="defaultFile"/>
    <Item typeMapping="Binary" cached="false" storageId="defaultFile"/>

When dynamic component presentations are published as ASCX Controls they must be published to the file system in order to render properly.

2
  • 3
    That change will cause everything except pages and binaries (unless you have more mappings beneath there) to be published to that data location, which (depending on what you're publishing) could cause more issues. You might want to consider adding a specific mapping for your ASCX Component Presentations and leaving the default as it was Sep 20, 2013 at 15:01
  • Hmm... but David suggested checking your storage config. All you've done is vary this slightly by using a default rather than an explicit mapping. David solved your problem for you and deserves the credit. Or am I wrong? Sep 21, 2013 at 14:26
5

I'd like to add that the same concept applies to DCPs published as JSP Script. These must be present on the file system.

If an absolute requirement exists to have these published to the Broker DB, then custom code needs to be developed to serialize the JSP or ASCX output into a file prior to trying to render it. You may also try a technique of compiling all in memory (reach out to Mihai's blog for goodness around that: http://yatb.mitza.net).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.