How to adjust the page size on server controls or API

  • Updated

When you attempt to populate a list of items using a server control or the API (Legacy/Framework), it defaults to displaying up to 50 items.

The default for most server controls and API calls are to return 50 results to improve performance.

You can modify the code on a page to allow for more items to be visible. 

  1. Server controls , and older API calls, have a PageSize property or MaxResults property that is defaulted to 50. To change this property on the control, add a value such as PageSize="100" to the control.
  2. The Framework API uses a paging object. The following example shows how to create a paging object, which the criteria methods use. 

    Ektron.Cms.Framework.Content.ContentManager contentManager = new Ektron.Cms.Framework.Content.ContentManager();
    Ektron.Cms.Content.ContentCriteria criteria = new Ektron.Cms.Content.ContentCriteria();
    Ektron.Cms.PagingInfo pagingInfo = new Ektron.Cms.PagingInfo();
    //sets the page of results you want
    pagingInfo.CurrentPage = 1;
    //how many items to return per page
    pagingInfo.RecordsPerPage = 100;
    criteria.AddFilter(Ektron.Cms.Common.ContentProperty.FolderId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, 0);
    criteria.PagingInfo = pagingInfo;
    var contentList = contentManager.GetList(criteria);