Copied to clipboard

Flag this post as spam?

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


  • Robert 63 posts 282 karma points
    Mar 02, 2015 @ 17:09
    Robert
    0

    Determine the DocumentType

    Hi,

    In a partial view, how can i determine the documentType of an item to display some other things?

    I want to do something like:

    if (item.documentType == "ExternalLink"){
    Do this
    }
    else {do that}
    }
    
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 02, 2015 @ 17:16
    Jan Skovgaard
    0

    Hi Robert

    You should be able to use item.DocumentTypeAlias == "ExternalLink"...so this should work

    @if(item.DocumentTypeAlias == "ExternalLink"){
      //Your code here
    }
    

    /Jan

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Mar 02, 2015 @ 17:18
    Dennis Aaen
    0

    Hi Robert,

    I think something like this will work for you if not could you please share your whole code.

    if(item.DocumentTypeAlias == "ExternalLink"){
    Do this
    }else {
    do that
    }

    Hope this helps,

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft