# C1.C1Preview.OutputRange.GetNextPage

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_C1Preview_OutputRange_GetNextPage_" data-uid="C1.C1Preview.OutputRange.GetNextPage*">GetNextPage Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_C1Preview_OutputRange_GetNextPage_" data-uid="C1.C1Preview.OutputRange.GetNextPage*"></a>
<h4 id="C1_C1Preview_OutputRange_GetNextPage_System_Int32_" data-uid="C1.C1Preview.OutputRange.GetNextPage(System.Int32)">GetNextPage(int)</h4>
<div class="markdown level1 summary"><p>Returns the page number in the range following the specified one, or
-1 if the specified number was the last one.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int GetNextPage(int pageNumber)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetNextPage(pageNumber As Integer) As Integer</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">pageNumber</span></td>
      <td><p>The current page number.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><p>The next page number or -1 if there's none.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Preview_OutputRange_GetNextPage_" data-uid="C1.C1Preview.OutputRange.GetNextPage*"></a>
<h4 id="C1_C1Preview_OutputRange_GetNextPage_System_Int32_System_Int32__" data-uid="C1.C1Preview.OutputRange.GetNextPage(System.Int32,System.Int32@)">GetNextPage(int, ref int)</h4>
<div class="markdown level1 summary"><p>Returns the page number in the range following the specified one, or
-1 if the specified number was the last one.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int GetNextPage(int pageNumber, ref int cookie)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetNextPage(pageNumber As Integer, ByRef cookie As Integer) As Integer</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">pageNumber</span></td>
      <td><p>The current page number.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">cookie</span></td>
      <td><p>A cookie used to avoid infinite loops in cases where the same page number appears in several ranges.
Set this value to 0 before the first call to this method.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><p>The next page number or -1 if there's none.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
