我想实现数字分页,但一直只显示 “1”,用按钮“上一页”,“下一页”的话,也不管用,不能点击 <form id="form1" runat="server">
<div>
<asp:DataPager ID="DataPager1" runat="server" PagedControlID="lvPaging" PageSize="5">
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
</Fields>
</asp:DataPager><br />
<asp:ListView ID="lvPaging" runat="server" OnItemCreated="lvPaging_ItemCreated" >
<ItemTemplate>
<asp:Label ID="lbXUHao" runat="server" ForeColor="Blue"></asp:Label>
<%#Eval("id") %>
<%#Eval("Title") %>
<%#Eval("Content") %>
</ItemTemplate>
<ItemSeparatorTemplate>
----------------------------------------<br />
</ItemSeparatorTemplate>
</asp:ListView><br />
<asp:DataPager ID="DPNumber" runat="server" PagedControlID="lvPaging" PageSize="5" OnPreRender="DPNumber_PreRender">
<Fields>
<asp:NextPreviousPagerField FirstPageText="<<" LastPageText="" NextPageText="" PreviousPageText="" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField FirstPageText="" LastPageText=">>" NextPageText="" PreviousPageText="" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
</Fields>
</asp:DataPager>
</div>
</form>
这是我的前台代码,后台只有一个ListView的绑定,目前没有实现翻页功能,我想实现翻页功能
问题描述再具体一些
自己写一个吧,分页也不难的,用stringbuilder拼接a标签,最后将a标签放到页面上,用javascript触发事件就行了
哦哦,谢谢了,但是我还是想把ListView和Datapager这种方式的弄出来