未处理的事件"PageIndexChanging" 之解决方案
时间:2021-07-01 10:21:17
帮助过:11人阅读
解决方法如下:
给GridView控件添加一个事件PageIndexChanging,并设置GridView的属性:AllowPaging="True"
代码如下:
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GridView1.datasource="数据源"; GridView1.DataBind();
}