Xpath checkboxlist trouble getting values with Razor
I'm using the Xpath checkboxlist to basically categorize my pages. In my case I'm categorizing news items into housing associations. This is so I can view news relevant to a housing association. I can't use tags as they are being used in addition to this.
Where I'm listing my news items I want to be able to select news items that have a housing association ticked but I can't ever seem to get a value for the Xpath checkboxlist. Here is my code:
var NewsItems = Model.Descendants("NewsItem").OrderBy("postDate desc"); var housingAssociation = Model.AncestorsOrSelf().Where("NodeTypeAlias == \"HousingAssociation\"")[0] NewsItems = NewsItems.Where("housingAssociation.Contains(\"" + housingAssociation.Id + "\")");
However when I debug the housingAssociation property of an individual news item is always empty.
Has anybody else has this issue or know how I can resolve?
Xpath checkboxlist trouble getting values with Razor
I'm using the Xpath checkboxlist to basically categorize my pages. In my case I'm categorizing news items into housing associations. This is so I can view news relevant to a housing association. I can't use tags as they are being used in addition to this.
Where I'm listing my news items I want to be able to select news items that have a housing association ticked but I can't ever seem to get a value for the Xpath checkboxlist. Here is my code:
However when I debug the housingAssociation property of an individual news item is always empty.
Has anybody else has this issue or know how I can resolve?
Thanks
is working on a reply...