Copied to clipboard

Flag this post as spam?

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


  • Suhas Chatekar 1 post 21 karma points
    Dec 03, 2013 @ 22:16
    Suhas Chatekar
    0

    Umbraco - Try to read document properties programatically but always getting null

    I am writing a console application to read content from my umbraco database. I am unable to get following simple code to work. This code is using Umbraco 4.x

            var doc = new Document(1081);
            Console.WriteLine("Package Id: {0}", doc.getProperty("packageId").Value);
    

    There is a document in Umbraco and I have created content against that document. The content node is published and has id of 1081. The first line works fine and returns me the correct content node but second line fails to retrieve the property named packageId. There is a property with this name on the document type and I can see this value in the xml of the content node in cmsContentXml table in Umbraco database.

    Is running this inside a console application a problem? I do not seem me to think so otherwise the first line of code would not have worked either.

Please Sign in or register to post replies

Write your reply to:

Draft