Copied to clipboard

Flag this post as spam?

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


  • Fuji Kusaka 2203 posts 4220 karma points
    Jan 15, 2013 @ 09:20
    Fuji Kusaka
    0

    Display Certain Node depending on Value of dropDown List

    Hi folks,

    I have a list of node where admin can define the type of the node by using a dropdown list with a selection of values set to integer.

    Can someone point out how to i display all nodes with let say value = 1 in my loop? 

     

                       foreach(var p in projectList)){
                            @p.Name
                        }

     

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Jan 15, 2013 @ 10:15
    Fuji Kusaka
    0

    Sorry i cant edit my previous post, what i would  like to know is, is there a better way of doing this instead ?

    foreach(var p in projectList)){
    if(p.type == "1"){
                           @p.Name
    }
                       }
  • Niels Jorck Ellegaard 39 posts 245 karma points
    Jan 22, 2013 @ 13:00
    Niels Jorck Ellegaard
    0

    I belive, what you are looking for is this:

    foreach(var p in projectList.Where(p => p.type == "1")
    {
    @p.Name
  • Fuji Kusaka 2203 posts 4220 karma points
    Jan 23, 2013 @ 05:25
    Fuji Kusaka
    0

    Hi Niels,

    Thanks for the reply, well i did solved this by instead making use of document Types. since some of the requirements from the client changed.

      @foreach(var p in projects.Children.Where("NodeTypeAlias == \"docType\"").Where("!pjtCompleted")){
             @p.Name
    }

    //fuji

Please Sign in or register to post replies

Write your reply to:

Draft