AI OnAI Off
This cannot be achived with just FindPagesWithCriteria and PropertyCriteria. You have to use a filter afterwards. See http://www.frederikvig.com/2009/05/episerver-filter-part-1/. Or just a loop.
You can do the other way around, search for properties that is null.
How do I search for pages with any value in a given property? I can do a search for pages with a specific value in the property, but I can't figure out how to search for "not empty".
For example, this doesn't work:
var criterias = newPropertyCriteriaCollection
{
new PropertyCriteria()
{
Condition = CompareCondition.NotEqual,
Name = "MyProperty",
IsNull = false,
Type = PropertyDataType.String,
Value = ""
}
};
var pages = DataFactory.Instance.FindPagesWithCriteria(PageReference.StartPage, criterias);
An exception is thrown, "The crieria value cannot be null or empty. Set the IsNull property to search for null."
Any ideas?