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>
|