Copied to clipboard

Flag this post as spam?

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


  • Dmitrij Jazel 86 posts 179 karma points
    Jul 16, 2012 @ 23:30
    Dmitrij Jazel
    0

    node doctype in .net

    Hej Guys,

    It is quite odd, but I could not get exact answer on this one... But I really want to solve this one.

    In C#.net code here, I am accessing node. I wanted to check a doctype of its' children, take a look at here:

       protected void Page_Load(object sender, EventArgs e)
            {
                // Current page node
                var node = Node.GetCurrent();
    
                BulletedList listGroups = new BulletedList();
    
                foreach (Node n in node.Children)
                {
                    //1) If node doctype is = "specialNode"
                        // Do "specialNode" code...
                }
    
            }

    Any suggestions? :)

    Dmitrij

  • Douglas Ludlow 210 posts 366 karma points
    Jul 17, 2012 @ 00:31
    Douglas Ludlow
    0

    NodeTypeAlias is the property that you'll want to use. Autocomplete will save you most of the time.

    protected void Page_Load(object sender, EventArgs e)
    {
    // Current page node
    var node = Node.GetCurrent();

    BulletedList listGroups = new BulletedList();

    foreach (Node n in node.Children)
    {
    if (n.NodeTypeAlias == "specialNode")
    {
    // Do "specialNode" code...
    }
    }
    }
  • Dmitrij Jazel 86 posts 179 karma points
    Jul 17, 2012 @ 08:28
    Dmitrij Jazel
    0

    Hej Diuglas,

    This is great :) thanks for help ;)

    Dmitrij 

Please Sign in or register to post replies

Write your reply to:

Draft