More in this section

Forums / Developing with Sitefinity / Use SF API from another project (ASP.NET MVC)

Use SF API from another project (ASP.NET MVC)

2 posts, 0 answered
  1. RAFAEL
    RAFAEL avatar
    1 posts
    Registered:
    21 May 2009
    29 Apr 2010
    Link to this post
    Is it possible to use SF API from another ASP.NET MVC project (adding in my ASP.NET MVC project references to SF dll's, modifing my web.config, copying resources,  etc)

    In my project I want to extract some content and use it. It is very important performance so I don't want to use a web service o something similar

    Example

    // In my ASP.NET MVC controller


    // create new instance of NewsManager
    Telerik.News.NewsManager newsManager = new Telerik.News.NewsManager("News");

    // get all content items
    IList listOfContentItems = newsManager.GetContent();
    if (listOfContentItems.Count > 0)
    {
       
    foreach(Telerik.Cms.Engine.IContent contentItem in listOfContentItems)

    // Process info
    }


  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    29 Apr 2010
    Link to this post
    Hello RAFAEL,

    Thank you for using our services.

    Data coming from any provider in Sitefinity can be extracted only in the context of the application it is coming from. In this line of though the way to use it in an external project is through web services. This is the same as in other .NET applications. You should host the webservice on your Sitefinity website and then call it from the ASP.NET MVC application to get the data. Bellow are three blog posts from our blogs which sample the creation and use of web services:
    http://www.sitefinity.com/blogs/radoslavgeorgiev/posts/09-11-11/use_the_content_manager_api_in_a_web_service.aspx
    http://www.sitefinity.com/blogs/radoslavgeorgiev/posts/09-11-06/enable_loading_of_cms_pages_through_an_ajax_web_service.aspx
    http://www.sitefinity.com/blogs/ivandimitrov/ivanposts/10-01-22/implementing_scheduled_services_in_sitefinity_3_x.aspx

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
2 posts, 0 answered