Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Accessing Kentico from external asp.net application View modes: 
User avatar
Member
Member
Neelesh.Malvi-ingrammicro - 2/6/2014 8:58:25 AM
   
Accessing Kentico from external asp.net application
Hi,

Problem:-
[CMSDataProperties.LoadTransformation]: Could not load type 'CMS.Controls.CMSTransformation'.

My work around:-

1) I have created on ASP.net application
2) Added kentico reference in the ASP.net application
3) After this i have used CMS repeater control an trying to bind news data to this control.

Here is my code:
Code behind:
TreeProvider tp = new TreeProvider();
DataSet ds = tp.SelectNodes("CorporateSite", "/news/%", "en-us", true, "cms.news", " NewsReleaseDate <= GetDate() ", " NewsReleaseDate DESC ", -1, true);
CMSRepeater1.DataSource = ds;
CMSRepeater1.DataBind();

HTML:
<cms:CMSRepeater ID="CMSRepeater1" runat="server" ClassNames="cms.news" SiteName="CorporateSite" TransformationName="cms.news.preview" SelectedItemTransformationName="cms.news.default">
<ItemTemplate>
<strong>
<%# Eval("NewsTitle") %>
</strong>
(<%# ((DateTime) Eval("NewsReleaseDate")).ToString("d") %>)
<br />
<i><%# Eval("NewsSummary") %></i>
<br />
</ItemTemplate>
</cms:CMSRepeater>

Transformation:
<div class="newsItem">
<p><strong><a href="<%#GetDocumentUrl()%>"
<%#Eval("NewsTitle",true)%></a></strong></p>
<p><%#StripTags(Eval("NewsSummary"))%></p>
</div>

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 2/6/2014 11:41:43 AM
   
RE:Accessing Kentico from external asp.net application
Did you include all the dll references in your other website?

On another note, why recreate the wheel? Why not just create the page/control within Kentico?

User avatar
Member
Member
kentico_sandroj - 2/6/2014 2:06:00 PM
   
RE:Accessing Kentico from external asp.net application
Hello,

Have you followed the documentation for including the references and connecting to the database? That seems to be the issue here.

Please let me know if you have any questions.

Best Regards,
Sandro

User avatar
Member
Member
Neelesh.Malvi-ingrammicro - 2/8/2014 3:23:44 AM
   
RE:Accessing Kentico from external asp.net application
yes i have followed. When i am using ASp.net repeater control it works fine but here i am using CMS repeater control as i mentioned above.

I think issue in transformation but i am unable to identified.

Help will appreciate...

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 2/10/2014 5:58:08 AM
   
RE:Accessing Kentico from external asp.net application
Hi,

Have you followed the steps from Using API and CMS Controls outside the CMS project - part Enabling ASCX transformations in external applications, both parts Registering the Virtual path provider and especially the latter Adding the CMSTransformation class?
If not, please review your steps and follow those instructions, it should help.

Regards,
Zdenek