public class AspPager
{
public static void AspNetPager(GridView gv, DataSet ds, Wuqi.Webdiyer.AspNetPager asppager, string where)
{
DataView dv = new DataView(ds.Tables[0]);
dv.RowFilter = where;
asppager.RecordCount = dv.Count;
PagedDataSource pds = new PagedDataSource();
pds.DataSource = dv;
pds.AllowPaging = true;
pds.CurrentPageIndex = asppager.CurrentPageIndex - 1;
pds.PageSize = asppager.PageSize;
gv.DataSource = pds;
gv.DataBind();
}
public static void AspNetPager(DataList dl, DataSet ds, Wuqi.Webdiyer.AspNetPager asppager, string where)
{
DataView dv = new DataView(ds.Tables[0]);
dv.RowFilter = where;
asppager.RecordCount = dv.Count;
PagedDataSource pds = new PagedDataSource();
pds.DataSource = dv;
pds.AllowPaging = true;
pds.CurrentPageIndex = asppager.CurrentPageIndex - 1;
pds.PageSize = asppager.PageSize;
dl.DataSource = pds;
dl.DataBind();
}
public static void AspNetPager(Repeater dl, DataSet ds, Wuqi.Webdiyer.AspNetPager asppager, string where)
{
DataView dv = new DataView(ds.Tables[0]);
dv.RowFilter = where;
asppager.RecordCount = dv.Count;
PagedDataSource pds = new PagedDataSource();
pds.DataSource = dv;
pds.AllowPaging = true;
pds.CurrentPageIndex = asppager.CurrentPageIndex - 1;
pds.PageSize = asppager.PageSize;
dl.DataSource = pds;
dl.DataBind();
}
}