Copied to clipboard

Flag this post as spam?

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


  • Dan Sørensen 102 posts 327 karma points
    Apr 24, 2014 @ 15:05
    Dan Sørensen
    0

    How to use @helper render

    Im trying to use render helper fucktions like this

    <div class="col3">
       @RenderMember(member, currentPageModel);
    </div>
    
    
    @helper RenderMember(umbraco.cms.businesslogic.member.Member member, Umbraco.Web.Models.DynamicPublishedContent currentPage) 
    {
    // render stuff
    }
    

    But I cant get it to work is there something im doing worng. I dont want to write all the render stuff in each div where i need this to be rendered.

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Apr 24, 2014 @ 15:15
    Jan Skovgaard
    0

    Hi Dan

    Do you get any error message? or does nothing render at all?

    /Jan

  • Robert Foster 440 posts 1684 karma points MVP admin c-trib
    Apr 24, 2014 @ 15:27
    Robert Foster
    101

    hey, the following post may help you:

    http://weblogs.asp.net/scottgu/archive/2011/05/12/asp-net-mvc-3-and-the-helper-syntax-within-razor.aspx

    one thing - does it make a difference if you place the @helper at the start of the file?  I've always done this, and suspect it may help with parsing, but not sure.

  • Dan Sørensen 102 posts 327 karma points
    Apr 24, 2014 @ 17:46
    Dan Sørensen
    0

    I got an error but think I posted the question to fast because I found out what was wrong a second after and it was not with the helper. but Robert you post was interesting and will help me in the future!

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Apr 24, 2014 @ 17:51
    Jan Skovgaard
    0

    Hi Dan

    Glad to hear you got it solved :)

    Do you care to share the error as well as your solution? Just so others can benefit if they come across the same thing.

    Cheers, /Jan

  • Dan Sørensen 102 posts 327 karma points
    Apr 25, 2014 @ 14:27
    Dan Sørensen
    0

    Hi Jan

    The error was not even with the @helper so if I should write the solution then it would make more sense to make a hole new question :P

  • 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