使用AspNetPager分页,跳转后,返回到当前分页页面
关键是要通过执行AspNetPager的PageChanging事件,来指定AspNetPager的当前页面。
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (!string.IsNullOrEmpty(Request.QueryString["pageindex"]))
pager_PageChanging(AspNetPager1, new Wuqi.Webdiyer.PageChangingEventArgs(int.Parse(Request.QueryString["pageindex"])));
else
BindInfo();
}
}
/// <summary>
/// 分页
/// </summary>
/// <param name="src"></param>
/// <param name="e"></param>
protected void pager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
{
AspNetPager1.CurrentPageIndex = e.NewPageIndex;
BindInfo();
}