My PageDataCollection some times returns all pages (irrespective of the PageStatus like - Published, Expired ...) and at other times returns only pages that are Published. Is there anything wrong with the way I use "FindPagesWithCriteria".
PageDataCollection colPages = new PageDataCollection();
PropertyCriteriaCollection col = new PropertyCriteriaCollection();
PropertyCriteria crForm = new PropertyCriteria();
crForm.Type = PropertyDataType.String;
crForm.Condition = CompareCondition.Equal;
crForm.Name = "PageTypeName";
crForm.Value = strPageTypeName;
crForm.Required = true;
col.Add(crForm);
colPages = Global.EPDataFactory.FindPagesWithCriteria(EPiServer.Global.EPConfig.StartPage,col);
PageDataCollection colPages = new PageDataCollection(); PropertyCriteriaCollection col = new PropertyCriteriaCollection(); PropertyCriteria crForm = new PropertyCriteria(); crForm.Type = PropertyDataType.String; crForm.Condition = CompareCondition.Equal; crForm.Name = "PageTypeName"; crForm.Value = strPageTypeName; crForm.Required = true; col.Add(crForm); colPages = Global.EPDataFactory.FindPagesWithCriteria(EPiServer.Global.EPConfig.StartPage,col);