Hi,
I have a custom property that exists on certain pages. I want to get a PageCollection of these pages that have this property (property is called "Placement").
How can I use the FindPagesWithCriteria function to get such a page collection ? I've tried, but without success.
myCriteria = new PropertyCriteria();
myCriteria.Name = "Placement";
myCriteria.IsNull = false;
PropertyCriteriaCollection col = new PropertyCriteriaCollection();
col.Add(myCriteria);
PageDataCollection colPages = Global.EPDataFactory.FindPagesWithCriteria ( Global.EPConfig.StartPage, col);
Thanks
Danie
Just a guess, but you have not specified the PropertyType...
i.e
myCriteria.Type = EPiServer.Core.PropertyDataType.String;
Assuming this is a string, of course!
myCriteria = new PropertyCriteria(); myCriteria.Name = "Placement"; myCriteria.IsNull = false; PropertyCriteriaCollection col = new PropertyCriteriaCollection(); col.Add(myCriteria); PageDataCollection colPages = Global.EPDataFactory.FindPagesWithCriteria ( Global.EPConfig.StartPage, col);
Thanks Danie