1个回答
展开全部
给你个代码,比较长啊~~~
<asp:GridView ID="gridview1" DataSourceID="数据源" runat="server" AllowPaging = True OnPageIndexChanging="gvShow_PageIndexChanging">
这四个button用来翻页
<asp:Button ID="butFirst" CommandName="Page" CommandArgument="First" Text="首页" runat=server/>
<asp:Button ID="butPrev" CommandName="Page" CommandArgument="Prev" Text="上一页" runat=server/>
<asp:Button ID="butNext" CommandName="Page" CommandArgument="Next" Text="下一页" runat=server/>
<asp:Button ID="butLast" CommandName="Page" CommandArgument="Last" Text="末页" runat=server/>
后台翻页事件
protected void gvShow_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
绑定数据源
}
<asp:GridView ID="gridview1" DataSourceID="数据源" runat="server" AllowPaging = True OnPageIndexChanging="gvShow_PageIndexChanging">
这四个button用来翻页
<asp:Button ID="butFirst" CommandName="Page" CommandArgument="First" Text="首页" runat=server/>
<asp:Button ID="butPrev" CommandName="Page" CommandArgument="Prev" Text="上一页" runat=server/>
<asp:Button ID="butNext" CommandName="Page" CommandArgument="Next" Text="下一页" runat=server/>
<asp:Button ID="butLast" CommandName="Page" CommandArgument="Last" Text="末页" runat=server/>
后台翻页事件
protected void gvShow_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
绑定数据源
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询