title: CSOM Query paginated Files results
body: <p>Trying to figure out how to update the following code to get paginated results by passing 'page' and 'pageSize':</p>
  <pre><code>using (ClientContext spClientContext = new AuthenticationManager().GetACSAppOnlyContext(siteUrl, _clientId, _clientSecret))
  {
      if (spClientContext != null)
      {
          CamlQuery camlQuery = new CamlQuery();
  
          camlQuery.ViewXml = &quot;&lt;View Scope=&quot;RecursiveAll&quot;&gt;&quot; +
              &quot;&lt;Query&gt;&quot; +
              &quot;&lt;Where&gt;&quot; +
              &quot;&lt;Eq&gt;&lt;FieldRef Name='FSObjType' /&gt;&lt;Value Type='Integer'&gt;0&lt;/Value&gt;&lt;/Eq&gt;&quot; +
              &quot;&lt;/Where&gt;&quot; +
              &quot;&lt;OrderBy&gt;&lt;FieldRef Name=\&quot;FileLeafRef\&quot; Ascending=\&quot;FALSE\&quot;/&gt;&lt;/OrderBy&gt;&quot; +
              &quot;&lt;/Query&gt;&quot; +
              &quot;&lt;RowLimit&gt;10&lt;/RowLimit&gt;&quot; +
              &quot;&lt;/View&gt;&quot;;
  
          List list = spClientContext.Web.Lists.GetByTitle(&quot;Documents&quot;);
  
          ListItemCollection listItems = list.GetItems(camlQuery);
  
          spClientContext.Load(listItems,
                               items =&gt; items.Include(
                                   item =&gt; item.DisplayName,
                                   item =&gt; item.FileSystemObjectType,
                                   item =&gt; item.File,
                                   item =&gt; item.File.Name,
                                   item =&gt; item.File.Author,
                                   item =&gt; item.File.ModifiedBy,
                                   item =&gt; item.File.ListItemAllFields[&quot;Created&quot;],
                                   item =&gt; item.File.ListItemAllFields[&quot;Modified&quot;],
                                   item =&gt; item.File.ListItemAllFields[&quot;FileRef&quot;],
                                   item =&gt; item.File.Length));
  
          spClientContext.ExecuteQuery();
  
          if (listItems != null &amp;&amp; listItems.Count &gt; 0)
          {
              foreach (ListItem item in listItems)
              {
                  if (item.FileSystemObjectType.Equals(FileSystemObjectType.File))
                  {
                      // Do Stuff
                  }
              }
          }
      }
  }
  </code></pre>
  <p>The code above would be included in a method where 'pageSize' would get passed to the CAML Query 'RowLimit' element value. That is working. I am fairly new to SharePoint CSOM dev so trying to figure out now how to set page or position so I can query only paginated results on request? Thanks for the help!</p>