I'm having trouble using the umbraco default datatype "related links". My problem is that I want to iterate the property's children/options. I've seen examples using xml and xslt but I'm wondering if there's any possibilty to use pure c# inside a User Control.
Something like this (But a working variant)
Node node = new Node(Node.getCurrentNodeId()); var linklist = node.GetProperty("link"); if (node.GetProperty("link") != null) { foreach (var item in linklist) { //get each item here } }
How to iterate a "Related Links" using C#
Hi!
I'm having trouble using the umbraco default datatype "related links". My problem is that I want to iterate the property's children/options. I've seen examples using xml and xslt but I'm wondering if there's any possibilty to use pure c# inside a User Control.
Something like this (But a working variant)
Thanks!
Do you have some code on how to do this in Razor? You can also use that code in a UserControl. Have a look here: http://our.umbraco.org/forum/developers/razor/27417-Use-Razor-code-in-UserControl?p=1#comment102639
Jeroen
Thansk for your reply, this is how I solved it,
http://stackoverflow.com/questions/13309285/how-to-iterate-a-related-links-using-c-sharp/13340586#13340586
is working on a reply...