【发布时间】:2011-10-28 15:17:39
【问题描述】:
我有一个 ListView,我正在使用 DataPager 进行分页。我正在使用存储过程来返回分页数据。存储过程返回总行数作为输出参数。
我的存储过程是
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
在我的列表视图布局中是
<asp:ListView ID="LstCatalogue" runat="server" OnSelectedIndexChanged="LstCatalogue_SelectedIndexChanged">
<LayoutTemplate>
<div id="productContent" class="center_Productcontent">
<div runat="server" id="ItemPlaceholder"></li>
</div>
<div class="Pager">
<asp:DataPager ID="pgrUpper" runat="server" PageSize="9" PagedControlID="LstCatalogue">
<Fields>
<asp:NextPreviousPagerField ButtonCssClass="command" FirstPageText="First" PreviousPageText="Previous" RenderDisabledButtonsAsLabels="true" RenderNonBreakingSpacesBetweenControls="true" ShowFirstPageButton="true" ShowNextPageButton="false" ShowLastPageButton="false" ShowPreviousPageButton="true" />
<asp:NumericPagerField ButtonCount="10" NumericButtonCssClass="command" CurrentPageLabelCssClass="current" NextPreviousButtonCssClass="command" RenderNonBreakingSpacesBetweenControls="true" />
<asp:NextPreviousPagerField ButtonCssClass="command" NextPageText="Next" LastPageText="Last" RenderDisabledButtonsAsLabels="true" ShowFirstPageButton="false" ShowPreviousPageButton="false" ShowNextPageButton="true" ShowLastPageButton="true" />
</Fields>
</asp:DataPager>
</div>
</LayoutTemplate>
</asp:ListView>
我的问题是如何根据存储过程中的分页数据在 datapager.based 中设置分页。
【问题讨论】:
标签: asp.net