Copied to clipboard

Flag this post as spam?

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


  • sumathi 7 posts 77 karma points
    Jan 29, 2016 @ 11:28
    sumathi
    0

    Facing error in view, if creating any page its shows some error,it doesn't preview.

    Facing error in view, if creating any page its shows some error,it doesn't preview. Error:'Umbraco.Web.Models.DynamicPublishedContentList' does not contain a definition for 'Any'. enter image description here

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 30, 2016 @ 10:31
    Jan Skovgaard
    0

    Hi Sumathi and welcome to our :)

    Can you provide some more information about this issue? What exact version of Umbraco 7 are you using and have you installed some kind of starter kit or have you been starting out from scratch? Judging from the screendump above it seems like you have been trying to create a view or macro based on one of the build-in templates in Umbraco from the dropdown in the "Create" dialogue - Perhaps you can post the complete code example so it's easier for others to get the full context of what's going on as well?

    /Jan

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 30, 2016 @ 10:49
    Dennis Aaen
    1

    Hi sumathi,

    The Razor code below should list child pages from the current page, if the page, has some children.

    @{ var selection = CurrentPage.Children.Where("Visible"); }
    
    @if (selection.Any())
    {
        <ul>
            @foreach (var item in selection)
            {
                <li>
                    <a href="@item.Url">@item.Name</a>
                </li>
            }
        </ul>
    }
    

    Hope this helps,

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft