FindPagesWithCriteria works different in CMS 6 R2

I am currently upgrading a site to run under EPiServer CMS 6 R2

One thing that struck me was that I got zero results back when using code that earlier had been tested and worked.
The code below works fine in CMS 6.0:

DataFactory.Instance.FindPagesWithCriteria(PageReference.StartPage, criteria);

After the R2 upgrade that code yielded no results.

The solution is to add null as a parameter for language branch as this:


The null in this case means any language.

I had earlier run into another problem using PageType Builder and learned to add the extension method .AsTyped() if the code yielded no result when searching for typed pages.

To be totally confident that my code wont break I now have to create a search and replace with:


The big question is why the code broke after the R2 upgrade? I can’t find any documentation stating that you must enter null as language branch.

What changes have been made to the FindPagesWithCriteria method?


4 thoughts on “FindPagesWithCriteria works different in CMS 6 R2

  1. Tom, I am aware of that but the main problem is that the code stopped working without the null parameter, when I added the null parameter it worked as before. The AsTyped is added as a precaution.

  2. Hi Danbad

    Can you please help me?

    We have EPiServer CMS 6 R2 along with EPiServer Commuity and Relate Plus. Also we have built an ASP.NET web site with a forum on top of it (the forum is using the community and relate APIs). There is a request that each forum topic and its replies have multiple file attachments (documents, images and videos). Since I am new to EpiServer, can someone please let me know how can I implement this?

    In my newtopic.aspx file I have some text boxes only that receives the subject, body and other details then creates an instance of ForumTopic entity and inserts it into the database.

    Thanks a lot

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s