Copied to clipboard

Flag this post as spam?

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


  • dan 29 posts 53 karma points
    Dec 18, 2009 @ 19:45
    dan
    0

    Umbraco Item

    Does anyone know if there is an easy way to get the item field in C#. So for example. I want to set a string in my c# code behind to look for the specific item and grab the property.

    so many...

    string paragraph = [umbraco Item field]; --> <umbraco:Item field="Paragraph" runat="server"></umbraco:Item>

     


  • dan 29 posts 53 karma points
    Dec 18, 2009 @ 22:48
    dan
    0

    I used this

    umbraco.cms.businesslogic.web.Document field = new umbraco.cms.businesslogic.web.Document(1237);

     

    object emailbody = field.getProperty("FEmail").Value;

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Dec 19, 2009 @ 09:27
    Morten Bock
    0

    Be aware the the Document API goes to the database. If this is for published content, use the umbraco.presentation.nodefactory instead. Read more here:

    http://www.netaddicts.be/articles/document-api-vs-nodefactory.aspx

Please Sign in or register to post replies

Write your reply to:

Draft