Copied to clipboard

Flag this post as spam?

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


  • nickornotto 397 posts 900 karma points
    Sep 18, 2014 @ 15:26
    nickornotto
    0

    Strange... Node and DynamicNode don't read id

    I'm trying to pick up a node from supplied id so I use new Node() and new DynamicNode

    However none of it is working. See the code:

    @helper GetPriceRecursive(string nodeId)
    {
        int ni = Convert.ToInt32(nodeId);
        umbraco.NodeFactory.Node node = new umbraco.NodeFactory.Node(ni);
        @nodeId
        @(ni)
        <i>a</i>
        @node.Id
        <i>b</i>
        umbraco.MacroEngines.DynamicNode node1 = new umbraco.MacroEngines.DynamicNode(ni);
        @node1.Id
    }
    

    @ni and @nodeId display correct numeric value, eg. 1700

    But then @node.Id and @node1.Id display 0

    I sue both in my UmbracoTemplatePage view

    Any ideas?

  • Jeavon Leopold 3074 posts 13631 karma points MVP 11x admin c-trib
    Sep 19, 2014 @ 15:31
    Jeavon Leopold
    0

    Hi Eva,

    Before looking at your specific issue, why are you trying to use the legacy NodeFactory and DynamicNode in a MVC UmbracoTemplatePage View?

    We have IPublishedContent and DynamicPublished content for rendering published content now...?

    Jeavon

Please Sign in or register to post replies

Write your reply to:

Draft