Can't get this to work. The following code is in a partial and if the partial displays on the page with id 1089 it should display the content, but it displays nothing with no errors.
var currentPageId = CurrentPage.Id;
var pageId = 1089;
var casesort = Model.Content.Site().FirstChild("caseHistoryPage").Children().Where("pageId != currentPageId")
.Where(x => x.HasValue("Catagory") && x.GetPropertyValue
If I remove .Where("pageId != currentPageId") it displays on all pages that have the partial. I wish it to display only on the page with id 1089.
Use Page Id to display content
Can't get this to work. The following code is in a partial and if the partial displays on the page with id 1089 it should display the content, but it displays nothing with no errors.
var pageId = 1089; var casesort = Model.Content.Site().FirstChild("caseHistoryPage").Children().Where("pageId != currentPageId") .Where(x => x.HasValue("Catagory") && x.GetPropertyValue
If I remove .Where("pageId != currentPageId") it displays on all pages that have the partial. I wish it to display only on the page with id 1089.
Has anyone any ideas where i am going wrong?
I don't think you can use expressions like
"pageId != currentPageId"
why not just do (in razor):
Change
to
in fact better..
Thanks Soren and Steve
Both worked for me
is working on a reply...