Hi all,
I am trying to get node by hard coded id and then its children.
I tried the following code,
dynamic node = new DynamicNode(1052);
<p>@node.Id</p> // output is 1052
<p>@node</p>
foreach(var item in @node.Children().Where("Visible"))
{
<p>@item.movingClean</p> // output of this line is "System.Collections.Generic.List`1[System.String[]]"
//expected output is the values from each children corresponding to the alias "movingClean"
//"movingclean" is alias of textstring array
}
Working code without using dynamic node is as follows:
foreach (var item in CurrentPage.Children().Where("Visible"))
{
var count = 0;
foreach (var counter in item.movingclean)
{
count = count + 1;
}
for (int i = 0; i < count; i++){
foreach (var qLoop in item.movingclean[i]){
<p>@qLoop.InnerText</p>
}
}
}
umbraco 6.1.6
How can i get the items in children?
Please help,
Thanks
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/45995-get-node-by-id-and-chidren