November Happy Hour will be moved to Thursday December 5th.

Problem with PropertyCriteria

Vote:
 

I use a DataFactory.Instance.FindPagesWithCriteria(searchRoot, criterias).OfType<ProductPage>(); for a search function but i have a

problem with a criteria.

When i use PropertyDataType.Category i dont get any results if i use CompareCondition.Contained( SEE PASTED CODE)?

When i use CompareCondition.Equals everythings works fine, anyone have an idea what it can be?

 

 

        protected PropertyCriteriaCollection GetMarketCriterias(string searchText)
        {
            PropertyCriteriaCollection criterias = new PropertyCriteriaCollection();

            PropertyCriteria criteria = new PropertyCriteria();
            criteria.Name = "PageCategory";
            criteria.Required = false;
            criteria.Type = PropertyDataType.Category;
            criteria.Condition = CompareCondition.Contained;
            criteria.Value = searchText;

            criterias.Add(criteria);

            return criterias;
        }

 

 

Best regards //Andreas

#44335
Oct 08, 2010 15:40
Vote:
 

If i remember correctly PageCategory is an int, so you should use CompareCondition.Equal..

#44336
Oct 08, 2010 15:47
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.