Copied to clipboard

Flag this post as spam?

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


  • Dan 7 posts 27 karma points
    Oct 23, 2012 @ 16:46
    Dan
    0

    Recursive Syntax in vbhtml using Where

    Hi,

    I'm having trouble finding the correct where clause that does the following

    For Each a In Me.Model.AncestorsOrSelf()
        If Not a.advert.GetType = GetType(umbraco.MacroEngines.DynamicNull) Then
            If a.advert.GetType = GetType(umbraco.MacroEngines.DynamicXml) Then
                    ' node found
            End If
        End If
    Next

    Basically from this thread, I thought this would work

    Dim values = New Dictionary(Of String, Object)
        values.Add("empty", "")
        Dim ad = Me.Model.AncestorsOrSelf().Where("advert != empty", values).Last().advert

    but this returns DyamicNull whereas the first example loops the tree finding every node with advert element containing xml (I'm using the last one found)

    I'm using 4.7.0 and .vbhtml. Any help much appreciated.

    Dan

     

Please Sign in or register to post replies

Write your reply to:

Draft