Copied to clipboard

Flag this post as spam?

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


  • David McGawn 37 posts 150 karma points
    Sep 30, 2015 @ 12:12
    David McGawn
    0

    Varible check on Dropdown from a list view

    Am i being silly here of should this logically work. Or cant i use a varible to check?

    i have a list view of courses with faculties, and each page i am on has a drop down to select a faculty. I want to display in a dropdown on each page each course assosiated with this faculty.

    @foreach (var pageCourse in @Model.Content.AncestorOrSelf(1).Children.Where(x => x.Name == "Courselist"))
     {
      foreach (var subpageCourse in pageCourse.Children.Where("Visible").Where("courseListFaculty == \"@faculty\""))
      {
        <option value="">@subpageCourse.Name</option>
      }
    }
    

    if i change the @faculty to the actual string "A Level" it works and only displays from the faculty. but i want it to be dynamic per page from the dropdown value

    Thanks

    David

Please Sign in or register to post replies

Write your reply to:

Draft