Copied to clipboard

Flag this post as spam?

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


  • Spartaco 1 post 21 karma points
    Jan 08, 2013 @ 02:18
    Spartaco
    0

    DynamicNode.NiceUrl does not work sometimes

    Scenario,: this code does not work without the dummy line:

    @using umbraco.MacroEngines
    @{
        var previous = Model.Previous();
        var nextProduct = Model.Next();
    }
    @if (previous != null || nextProduct != null)
    {
        <div id="prev-next">
            @if (previous != null)
            {
                <a href="@previous.NiceUrl">
                    ..
                </a>
            }
            @if (nextProduct != null)
            {
                var dummy = nextProduct.Id; // this line fixes the bug
                <a href="@nextProduct.NiceUrl">
            ..
                </a>
            }
        </div>
    }

    Without the var dummy=... line the @nextProduct.NiceUrl returns #

     

Please Sign in or register to post replies

Write your reply to:

Draft