More in this section

Library items

4 posts, 0 answered
  1. Princely
    Princely avatar
    4 posts
    Registered:
    06 Aug 2008
    20 Aug 2008
    Link to this post
    Hi,

    How do I list all items(files) in a library by giving the library name?

    LibraryInfo myLib;
    myLib =
    new LibraryInfo("testLibrary11");


    and?
  2. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    20 Aug 2008
    Link to this post
    Hello Princely,

    You can find more information about finding libraries here:
    http://www.sitefinity.com/help/developer-manual/libraries-finding.html

    When you retrieve the library you will have ILibrary type of object, which is explained here:
    http://www.sitefinity.com/help/developer-manual/libraries-api-interfaces.html

    Finally, to get all the items of a particular library you can use code similar to following:
     // create new instance of LibraryManager  
    Telerik.Libraries.LibraryManager libraryManager = new Telerik.Libraries.LibraryManager();  
    // get library by specified Name  
    Telerik.Libraries.ILibrary theLibrary = libraryManager.GetLibrary("My First Library");  
    // get all items in a library  
    IList libraryItems = theLibrary.GetItems(); 

    I hope you'll find this information helpful. Let us know if there is anything else we can do for you.

    All the best,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Princely
    Princely avatar
    4 posts
    Registered:
    06 Aug 2008
    20 Aug 2008
    Link to this post
    Thx.
    It's working! cool!

  4. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    20 Aug 2008
    Link to this post
    Hello Princely,

    Always glad to be able to help. Let us know if there is anything else we can do for you.

    Greetings,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
4 posts, 0 answered