前台代码,写在gridview的代码里,不过我没用按钮,用的是标签:
CommandName="Page" CommandArgument="First"></asp:LinkButton>
CommandName="Page" CommandArgument="Prev"></asp:LinkButton>
CommandName="Page" CommandArgument="Next"></asp:LinkButton>
CommandName="Page" CommandArgument="Last"></asp:LinkButton>
到第
</PagerTemplate>
后台代码,在gridview的相应事件里写:
protected void Show_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
this.gridviewCus.PageIndex = e.NewPageIndex;
BindGridView();//数据源绑定方法
}