Dynamically setting pageno and maxrow to datapager control using a stored procedure
<p>I have a ListView and I am paging with a DataPager.i am using a stored procedure to return the paged Data.Stored procedure returns the total no of rows as out paramater.</p>

<p>my stored procedure is</p>

<pre><code>crate procedure [dbo].[Sp_ProductList]
@Id int,
@Country int,
@state int,
@City int,
@Group int,
@pageno int,
@pageCount int out
as begin
--custom search
end
</code></pre>

<p>in my List view  layout is</p>

<pre><code>  &lt;asp:ListView ID="LstCatalogue" runat="server" OnSelectedIndexChanged="LstCatalogue_SelectedIndexChanged"&gt;
    &lt;LayoutTemplate&gt;
&lt;div id="productContent" class="center_Productcontent"&gt;
                &lt;div runat="server" id="ItemPlaceholder"&gt;&lt;/li&gt;
            &lt;/div&gt;
    &lt;div class="Pager"&gt;
        &lt;asp:DataPager ID="pgrUpper" runat="server" PageSize="9" PagedControlID="LstCatalogue"&gt;
             &lt;Fields&gt;
             &lt;asp:NextPreviousPagerField ButtonCssClass="command" FirstPageText="First" PreviousPageText="Previous" RenderDisabledButtonsAsLabels="true" RenderNonBreakingSpacesBetweenControls="true"  ShowFirstPageButton="true" ShowNextPageButton="false" ShowLastPageButton="false"  ShowPreviousPageButton="true" /&gt;
             &lt;asp:NumericPagerField ButtonCount="10" NumericButtonCssClass="command" CurrentPageLabelCssClass="current" NextPreviousButtonCssClass="command" RenderNonBreakingSpacesBetweenControls="true" /&gt;
             &lt;asp:NextPreviousPagerField ButtonCssClass="command" NextPageText="Next" LastPageText="Last" RenderDisabledButtonsAsLabels="true" ShowFirstPageButton="false" ShowPreviousPageButton="false" ShowNextPageButton="true" ShowLastPageButton="true" /&gt;
        &lt;/Fields&gt;
      &lt;/asp:DataPager&gt;
            &lt;/div&gt;


        &lt;/LayoutTemplate&gt;
    &lt;/asp:ListView&gt;
</code></pre>

<p>My problem is how can i set paging in datapager.based on the paged data from the stored procedure.</p>
