Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I've this runtime error:
'umbraco.MacroEngines.DynamicNodeList' does not contain a definition for 'GetChildrenAsList
I checked DLLs, but I don't find any.
The code is:
@{ var items = Model.Parent.Children.Where("customerNo == \"" + @profile.Customer_NavisionCode + "\""); } <select id="Sede"> @foreach ( var p in items.Children()) { <option>@p.Name</option> } </select>
items is a DynamicNodeList.
you dont need the .Children again.
try this : @foreach(var p in items )
My target is to have the first level children of items
Hi,
I think what you should then do is loop through the items, and then display their children, so something like this:
@{ var items =Model.Parent.Children.Where("customerNo == \""+@profile.Customer_NavisionCode+"\""); } <selectid="Sede"> @foreach(var p in items) { @foreach(var c in p.Children) { <option>@c.Name</option> } } </select>
Hope this helps.
Cheers,
Michael.
I'll try. Children is a member of ' items'? Vs intellisense don't give me it
Don't work
Error
Unexpected "foreach" keyword after "@" character. Once inside code, you do not need to prefix constructs like "foreach" with "@".
Yes sorry,
The second "foreach" should not be prefixed with "@". So this should work better:
@{ var items =Model.Parent.Children.Where("customerNo == \""+@profile.Customer_NavisionCode+"\""); } <selectid="Sede"> @foreach(var p in items) { foreach(var c in p.Children) {<option>@c.Name</option> } } </select>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Error: 'umbraco.MacroEngines.DynamicNodeList' does not contain a definition for 'GetChildrenAsList
I've this runtime error:
'umbraco.MacroEngines.DynamicNodeList' does not contain a definition for 'GetChildrenAsList
I checked DLLs, but I don't find any.
The code is:
items is a DynamicNodeList.
you dont need the .Children again.
try this : @foreach(var p in items )
My target is to have the first level children of items
Hi,
I think what you should then do is loop through the items, and then display their children, so something like this:
Hope this helps.
Cheers,
Michael.
I'll try. Children is a member of ' items'? Vs intellisense don't give me it
Don't work
Error
Unexpected "foreach" keyword after "@" character. Once inside code, you do not need to prefix constructs like "foreach" with "@".
Yes sorry,
The second "foreach" should not be prefixed with "@". So this should work better:
Cheers,
Michael.
is working on a reply...