Hi
All built in properties are prefixed with "Page". So try changing to:
criteria.Name = "PageParentLink";
Does that make any difference?
Regards
Per Gunsarfs
EPiServer development team
Hi Per, when i try that i get an error: "No compare condition is defined."
Any idea what can be wrong?
Ok, when i use this, i still got no results...
PageDataCollection oPages;
PageReference oParent = PageReference.StartPage;
//Filter on the right
PropertyCriteriaCollection criterias = new PropertyCriteriaCollection();
PropertyCriteria criteria = new PropertyCriteria();
criteria.Type = PropertyDataType.Number;
criteria.Name = "PageParentLink";
criteria.Condition = CompareCondition.Equal;
criteria.Value = "27";
criteria.Required = true;
criterias.Add(criteria);
oPages = DataFactory.Instance.FindPagesWithCriteria(PageReference.StartPage, criterias);
//Bind Datasource to Control
MainNavRPT.DataSource = oPages;
MainNavRPT.DataBind();
Ah, sorry CompareCondition.Contained should be: CompareCondition.Equal , changed that for debugging reasons ;)
Ok, had to change criteria type to PageReference, it's working now:
criteria.Type = PropertyDataType.PageReference;
PageDataCollection oPages;
PageReference oParent = PageReference.StartPage;
//Filter on the right
PropertyCriteriaCollection criterias = new PropertyCriteriaCollection();
PropertyCriteria criteria = new PropertyCriteria();
criteria.Type = PropertyDataType.Number;
criteria.Name = "ParentLink";
criteria.Condition = CompareCondition.Contained;
criteria.Value = "27";
criteria.Required = true;
criterias.Add(criteria);
oPages = DataFactory.Instance.FindPagesWithCriteria(PageReference.StartPage,criterias);
I try to retrieve the pages from my root with Criteria Filter (yes i know i can use the getchildren, but want also use another Criteria).
Can someone tell me what i am doing wrong?