protected void Page_Load(object sender, EventArgs e)
{
AspNetPager1.RecordCount = (int)Socut.Data.ExecuteScalar("Select count(*) From NwebCn_About");
}
private void bind()
{
DataSet ds = Socut.Data.ExecuteDataSet("Select * From NwebCn_About order by Sequence asc", AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1), AspNetPager1.PageSize);
Repeater1.DataSource = ds;
Repeater1.DataBind();
}
protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
{
bind();
}
我按照官方的教程,是这样写的分页代码,不过我无论点击那一页都是第一页。错误的地方应该是AspNetPager1.CurrentPageIndex的值,不过我不知道怎么修改,所以请大家帮个忙,谢谢
------解决方案--------------------------------------------------------
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
是PageChanged事件吧