title: Paging not working on Dynamically populated JqGrid
body: <p>I have a requirement to populate a grid dynamically based on the selection of a view.
  I have followed the links below to populate the grid dynamically.</p>
  
  <p><a href="https://codereview.stackexchange.com/questions/3668/suggestions-for-jqgrid-dynamic-columns-and-server-side-paging-sortin-filterin">https://codereview.stackexchange.com/questions/3668/suggestions-for-jqgrid-dynamic-columns-and-server-side-paging-sortin-filterin</a></p>
  
  <p><a href="https://stackoverflow.com/questions/5111653/problem-showing-jqgrid-with-dynamic-column-binding">Problem showing jqgrid with dynamic column binding</a></p>
  
  <p>It uses two ajax calls. One to get the ColModel and ColNames for the JqGrid and the second call to get the colData.
  The data returned is only for the current Page (ie 20 records -Pagesize 20).</p>
  
  <p>The problem I have is my server side paging is not working. When I clicked on the next button on the pager, only the first page is loaded again.</p>
  
  <p>The code in the handler is as follows</p>
  
  <pre><code>                var numberOfRows = context.Request["rowsPerPage"];
                  int nRows, iPage;
                  if (String.IsNullOrEmpty(numberOfRows) || !int.TryParse(numberOfRows, NumberStyles.Integer, CultureInfo.InvariantCulture, out nRows))
                      nRows = PageSize; // default value
                  var pageIndex = context.Request["pageIndex"];
                  if (String.IsNullOrEmpty(pageIndex) || !int.TryParse(pageIndex, NumberStyles.Integer, CultureInfo.InvariantCulture, out iPage))
                      iPage = 1; // default value
  </code></pre>
  
  <p>context.Request["rowsPerPage"] and context.Request["pageIndex"] always returns null and gets set to the default values.
  What am I missing. Please help.</p>