Documentation > CMS Template API Library > PaginatedLinks > LinkAt(Int32)

LinkAt

Retrieves a link by index where 0 points to page 1, 1 points to page 2, etc.

public CrownPeak.CMSAPI.PageLink LinkAt(Int32)

Parameters

NameDescriptionType
index The index corresponding to the page number. This value is offset by one, so index 0 is page 1. System.Int32

Code Example

C#

Sample:

            
            List<Asset> children = asset.GetFileList();    
            PaginateResult result = Util.Paginate(children, 5);
             for(int i = 0; i < result.PaginatedLinks.Count; i++)
             {      
               Out.WriteLine("<a href=\"{0}\">{1}</a>", result.PaginatedLinks.LinkAt(i).ToString(), ++i);
             }        
            
            

Connect with Crownpeak