Copied to clipboard

Flag this post as spam?

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


  • Nicky Christensen 76 posts 166 karma points
    Nov 16, 2011 @ 11:45
    Nicky Christensen
    0

    Cannot invoke non-delegate type?

    Im getting an error on this simple razor script?

     

    @using umbraco.MacroEngines
    @inherits umbraco.MacroEngines.DynamicNodeContext

    @{

    if (Model.HasValue("address1") {
    <address>
    @Model.address1
    </address>
    }

    }

     

    If i remove the if sentence, it works - However, when making a check on it, it makes the error

  • Rodion Novoselov 694 posts 859 karma points
    Nov 16, 2011 @ 14:31
    Rodion Novoselov
    1

    Hi. Hmm. Is not there simply ")" missed in the end of the "if"?

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Nov 17, 2011 @ 19:20
    Sebastiaan Janssen
    0

    You can write this easier as well, you don't need the inherits and usings and don't need to put everything in a codeblock:

    @if(Model.HasValue("address1") {
    <address>@Model.address1</address>
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies