Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7920867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:22:32+00:00 2026-06-03T16:22:32+00:00

I’m currently implementing functionality in Tridion 2009 SP1 where the user is able to

  • 0

I’m currently implementing functionality in Tridion 2009 SP1 where the user is able to utilise a filter which in turn queries the broker for matching criteria and then returns the Component Presentations to the page.
Each item returned contains a component link.

Originally the dynamic CPs were stored in the broker DB as HTML fragments but it was discovered that when storing the CPs this way, Tridion would strip the component link from the content and leave a blank space in the HTML.

I then switched the setting so that the dynamic CPs are now stored on the filestore as ascx controls. When this setting is used, the <tridion:ComponentLink ... /> is successfully stored in the ascx file.

However, when I come to render the results to the screen, the component link is not being resolved and I am being left with the <tridion:ComponentLink ... /> in my resulting source.

Currently, I am using the GetComponentPresentation method to return the CP content which is then added to a List before being bound to a Repeater for display.

Summarised code is below:

ComponentPresentationFactory CPFactory = new ComponentPresentationFactory();
List<string> componentPresentations = new List<string>();

for (int i = 0; i < tbl.Rows.Count; i++)
{
    ComponentPresentation cp = CPFactory.GetComponentPresentation(
                                             tbl.Rows[i][0].ToString(), 
                                             strComponentTemplate.ToString());

    if (cp != null)
    {
        componentPresentations.Add(cp.Content);
    }
}

This list is the bound to the repeater in the usual way:

rptOffer.DataSource = componentPresentations;
rptOffer.DataBind();

Does anyone know how I can force the Component Link to be resolved and why the GetComponentPresentationfunction doesn’t do this for me?

Is there something that I should be doing differently or is this just not possible in the way I’m implementing this?

I have confirmed that the tridion tagprefix is correctly registered in the web.config.

I’m fairly new to Tridion so any help is greatly appreciated!

UPDATE

I’ve attempted to implement Will’s suggestion as it seems like the most appropriate solution for my scenario but I’m receiving a (pretty bland) error when I attempt to use Will’s suggestion with my code below:

ComponentPresentationAssembler cpa = new ComponentPresentationAssembler("tcm:35-62652-64");
string content = cpa.GetContent(tbl.Rows[i][0].ToString(), strComponentTemplate.ToString());

There are actually 2 errors which occur (seemingly) randomly but always at the cpa.GetContent(...) call. The errors are:

Exception occurred during configuration callback
OR
com.tridion.dcp.ComponentPresentationFactory

I can’t seem to figure out why the error changes between the times I run the code. The error changes even when no code changes are made.

Does anybody know what I’m missing here? I assumed that it would be an issue with the connectivity to the Broker storage etc but then I remembered that that part was working when I was using the ComponentPresentationFactory class.

If it helps, the DCP which is stored on the file store as an ascx contains the following HTML:

<div class="content-list-item offer redesign noImage">
<h2><span>Mike Offer 01/06 - 10/06 &amp; 20/06 - 10/07</span> Exp May 20th</h2>
<div class="content-list-item-text">
    <p>Body Text</p> 
    <div class="input-btn burgundy">
        <tridion:ComponentLink runat="server" PageURI="tcm:0-0-0" ComponentURI="tcm:35-31685" TemplateURI="tcm:0-0-0" AddAnchor="false" LinkText="Button Text&lt;span class=&#34;rm&#34;&gt;: Button Text&lt;/span&gt;" LinkAttributes=" alt=&#34;Button Text&#34; target=&#34;_self&#34; " TextOnFail="true"/>    
    </div>
        <p>Sub Title</p>
</div>
<div class="offers-list">        
    <ul>
        <li>Offer ends: 20 May 2012</li>
        <li>Offer available at all hotels</li>
    </ul>
</div>                          
<div class="back-to-top">
    <a href="#content">Back to top</a>
</div>

UPDATE 2

Thanks to Ryan, I’ve discovered that my DCP (ASCX) files weren’t being published within the application’s folder within the wwwroot folder which has solved the issue of it outputting the <tridion:ComponentLink ... /> tag directly to the source. It is now being rendered but the link is still not being resolved. The <a ... /> tags are not being output. This is where the Assembler will hopefully come in – once I can get this to work.

I’ve implemented more logging and checking and have more information on the error which suggests that I may be missing a jar file or have the incorrect version:

Exception Details: Java.Lang.ClassNotFoundException: com.tridion.dcp.ComponentPresentationFactory

The interesting this is, when I use the ComponentPresentationFactory class, it works (without resolving the internal link) but as soon as I use the Assembler, it throws the above error.

I have also attempted to add the Page to the constructor as suggested by Alvin but the output is the same.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:22:33+00:00Added an answer on June 3, 2026 at 4:22 pm

    As discussed already, in order to solve your problem you need to use the ComponentPresentationAssembler class, not the ComponentPresentationFactory class but you need to ensure that you use the ComponentPresentationAssembler class inside the Tridion.ContentDelivery.WAI namespace:

    Tridion.ContentDelivery.WAI.ComponentPresentationAssembler presentationAssembler = new Tridion.ContentDelivery.WAI.ComponentPresentationAssembler("tcm:5-44410-64",this.Page);
    Response.Write(presentationAssembler.GetContent("tcm:5-62700", "tcm:5-62627-32"));
    

    You also need to ensure:

    • Your ASCX files are published to the file system
      This is set in the cd_broker_conf.xml file inside the <Bindings> section e.g. <Binding Name="ASPComponentPresentation" Class="com.tridion.broker.componentpresentations.FSASCXComponentPresentationHome"/>

    • Your ASCX files are published inside your .Net web application.
      This is set in the cd_broker_conf.xml file inside the <Publications> section e.g.

      <Publication Id="5" DocumentRoot="C:/Inetpub/wwwroot/website1" DataRoot="C:/Inetpub/wwwroot/website1/dcp">
          <Dcp>
              <Asp Location="C:/Inetpub/wwwroot/website1/dcp"/>
          </Dcp>
      </Publication>
      

    Be aware that the locations you see above are case sensitive

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.