Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jefferycxl 35 posts 83 karma points
    Sep 08, 2010 @ 03:27
    jefferycxl
    0

    Retrieve a list of pages by document type using api

    Hi guys

    I would like retrieve a list of pages by their document type using umbraco api to create a user control, do you know where I can find a good code example for me to get start with this ?

    Thanks & Regards,

  • skiltz 501 posts 701 karma points
    Sep 08, 2010 @ 04:04
    skiltz
    1

    Are you using Umbraco 4.5.2?? If so highly recommend using Linq 2 Umbraco to acheive this.

     

    MyDataContext ctx =

     

    new MyDataContext();

     

     

    var pages = ctx.MyDocumentType;

     

     

    foreach (var item in pages)

    {

     

     

    //do stuff here

    }

Please Sign in or register to post replies

Write your reply to:

Draft