积极答复者
分页控件如何获取分页数据?

问题
答案
-
这里貌似要你自己写代码,然后进行绑定数据就可以了。
代码可以参考
绑定到DATAGRID ,这里只是举DATAGRID例,GRIDVIEW我没试过。
/// <summary>
/// 有两个任务:绑定数据集;显示记录信息
/// </summary>
public void DataBindChannel()
{
//绑定数据集
DataSet list = new DataSet();
int repeater1 = AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1);
int repeater2 = AspNetPager1.PageSize;
list = pager.GetAuthorsRows("authours", repeater1, repeater2);
dg.DataSource = list.Tables["authours"];
dg.DataBind();
//显示记录信息
AspNetPager1.CustomInfoText = "记录总数:<b>" + AspNetPager1.RecordCount.ToString() + "</b>";
AspNetPager1.CustomInfoText += " 总页数:<b>" + AspNetPager1.PageCount.ToString() + "</b>";
AspNetPager1.CustomInfoText += " 当前页:<font color=\"red\"><b>" + AspNetPager1.CurrentPageIndex.ToString() + "</b></font>";
}
http://www.cublog.cn/u/674/showart_175502.html
Frank Xu Lei--谦卑若愚,好学若饥
专注于.NET平台下分布式应用系统开发和企业应用系统集成
Focus on Distributed Applications Development and EAI based on .NET
【老徐的网站】:http://www.frankxulei.com/
【老徐的博客】:http://www.cnblogs.com/frank_xl/
- 已标记为答案 BoberSongModerator 2010年8月16日 7:03
-
你用的是这个控件呀,这个控件网站上帮助文档,有实例。你只要看看就OK.
下面是下载页面的地址,你下载“AspNetPager732Samples.rar”这个,这里面实例很多,什么样的分页效果都有,谁看谁知道。
http://www.webdiyer.com/Controls/AspNetPager/Downloads
- 已标记为答案 BoberSongModerator 2010年8月16日 7:03
全部回复
-
这里貌似要你自己写代码,然后进行绑定数据就可以了。
代码可以参考
绑定到DATAGRID ,这里只是举DATAGRID例,GRIDVIEW我没试过。
/// <summary>
/// 有两个任务:绑定数据集;显示记录信息
/// </summary>
public void DataBindChannel()
{
//绑定数据集
DataSet list = new DataSet();
int repeater1 = AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1);
int repeater2 = AspNetPager1.PageSize;
list = pager.GetAuthorsRows("authours", repeater1, repeater2);
dg.DataSource = list.Tables["authours"];
dg.DataBind();
//显示记录信息
AspNetPager1.CustomInfoText = "记录总数:<b>" + AspNetPager1.RecordCount.ToString() + "</b>";
AspNetPager1.CustomInfoText += " 总页数:<b>" + AspNetPager1.PageCount.ToString() + "</b>";
AspNetPager1.CustomInfoText += " 当前页:<font color=\"red\"><b>" + AspNetPager1.CurrentPageIndex.ToString() + "</b></font>";
}
http://www.cublog.cn/u/674/showart_175502.html
Frank Xu Lei--谦卑若愚,好学若饥
专注于.NET平台下分布式应用系统开发和企业应用系统集成
Focus on Distributed Applications Development and EAI based on .NET
【老徐的网站】:http://www.frankxulei.com/
【老徐的博客】:http://www.cnblogs.com/frank_xl/
- 已标记为答案 BoberSongModerator 2010年8月16日 7:03
-
你用的是这个控件呀,这个控件网站上帮助文档,有实例。你只要看看就OK.
下面是下载页面的地址,你下载“AspNetPager732Samples.rar”这个,这里面实例很多,什么样的分页效果都有,谁看谁知道。
http://www.webdiyer.com/Controls/AspNetPager/Downloads
- 已标记为答案 BoberSongModerator 2010年8月16日 7:03