Documentation > CMS Template API Library > PaginateResult
CrownPeak.CMSAPI.PaginateResult : CrownPeak.CMSAPI.PaginateResultBase`1[[CrownPeak.CMSAPI.Asset, CMSAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
Returns the results of the paginate call. You can enumerate over it to get the sub list items.
Name | Description | Type |
---|
Code Example
C#
Sample:
List<Asset> pressReleases = folder.GetFileList(); PaginateResult result = Util.Paginate(pressReleases, 10); // Print links to press releases on the current page foreach(Asset child in result) { Out.WriteLine("<a href=\"{0}\">{1}</a><br/>",child.GetLink(), child.Label); } // Print links to other pages foreach (PageLink link in result.PaginatedLinks) { if (link.IsCurrent()) { Out.WriteLine("{0}|", link.PageNumber); } else { Out.WriteLine("<a href=\"{0}\">{1}</a>|", link, link.PageNumber); } }