Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

How to filter Pages by first character of given condition

Vote:
 
Hi I need to filter pages which starts with 'X' character. PropertyCriteriaCollection col = new PropertyCriteriaCollection(); PropertyCriteria crForm = new PropertyCriteria(); crForm.Type = PropertyDataType.String; crForm.Condition = CompareCondition.Equal; crForm.Name = "PageTypeName"; crForm.Value = "GW_Form"; crForm.Required = true; col.Add(crForm); if( strAlpha != null ) // to filter only for selected alpha from pdcForms collection. { crForm.Type = PropertyDataType.String; crForm.Condition = (CompareCondition) EPiServer.Filters.StringCompareMethod.StartsWith; crForm.Name = "Title"; crForm.Value = strAlpha; crForm.Required = true; col.Add(crForm); } PageDataCollection pdcForms = new PageDataCollection(); pdcForms = Global.EPDataFactory.FindPagesWithCriteria(EPiServer.Global.EPConfig.StartPage,col); Thanks in advance Murali
#12656
May 30, 2006 12:39
* 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.