gridview存储过程
‘壹’ aspnetpage控件怎么把gridview分页 求详细代码 最好用存储过程
没用存贮过程的
private void Binder()
{
DataSet ds = DataHelpe.GetDataSet(strsql);
DataView dv = ds.Tables[0].DefaultView;
PagedDataSource pds = new PagedDataSource();
pagelist.RecordCount = dv.Count;
pagelist.AlwaysShow = true;
pagelist.PageSize = 20;
pds.DataSource = dv;
pds.AllowPaging = true;
pds.CurrentPageIndex = pagelist.CurrentPageIndex - 1;
pds.PageSize = pagelist.PageSize;
this.ddlUser.DataSource = pds;
this.ddlUser.DataBind();
this.pagelist.CustomInfoHTML = "记录总数:" + pagelist.RecordCount.ToString() + "";
}
pagelist是分页控件的ID
//PageChanging这个事件是分页控件自带的一个事件
protected void PageChanging(object src, PageChangingEventArgs e)
{
pagelist.CurrentPageIndex = e.NewPageIndex;
this.Binder();
}