<webdiyer:AspNetPager ID="AspNetPager1" runat="server"
FirstPageText='首页'
LastPageText='尾页' PagingButtonSpacing="10px" ShowPageIndexBox="Always" CustomInfoHTML="共%RecordCount%条,第%CurrentPageIndex%页 /共%PageCount% 页"
NextPageText="下一页" PrevPageText ="上一页"
ShowCustomInfoSection="Left"
SubmitButtonText ="Go" TextAfterPageIndexBox ="页"
TextBeforePageIndexBox ="转到 " UrlPaging="True"
CustomInfoSectionWidth="20%" CustomInfoTextAlign="Center"
onpagechanged="AspNetPager1_PageChanged">
</webdiyer:AspNetPager>void bind()
{ string wh2 = "";
DataSet da2 = st2.GetList(wh2);
DataView dv = da2.Tables[0].DefaultView;
PagedDataSource pds = new PagedDataSource();
AspNetPager1.RecordCount = dv.Count;
pds.DataSource = dv;
pds.AllowPaging = true;
pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
pds.PageSize = AspNetPager1.PageSize;
DataList2.DataSource = pds;
DataList2.DataBind(); }
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
bind();
}
这是分页代码 如何修改 或者给个例子 万分感谢
FirstPageText='首页'
LastPageText='尾页' PagingButtonSpacing="10px" ShowPageIndexBox="Always" CustomInfoHTML="共%RecordCount%条,第%CurrentPageIndex%页 /共%PageCount% 页"
NextPageText="下一页" PrevPageText ="上一页"
ShowCustomInfoSection="Left"
SubmitButtonText ="Go" TextAfterPageIndexBox ="页"
TextBeforePageIndexBox ="转到 " UrlPaging="True"
CustomInfoSectionWidth="20%" CustomInfoTextAlign="Center"
onpagechanged="AspNetPager1_PageChanged">
</webdiyer:AspNetPager>void bind()
{ string wh2 = "";
DataSet da2 = st2.GetList(wh2);
DataView dv = da2.Tables[0].DefaultView;
PagedDataSource pds = new PagedDataSource();
AspNetPager1.RecordCount = dv.Count;
pds.DataSource = dv;
pds.AllowPaging = true;
pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
pds.PageSize = AspNetPager1.PageSize;
DataList2.DataSource = pds;
DataList2.DataBind(); }
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
bind();
}
这是分页代码 如何修改 或者给个例子 万分感谢
解决方案 »
- 一个很奇怪的问题,不知道有解不
- vs2008怎么创建空白mvc程序呀?
- vb.net语法的asp.net 怎么能让datagrid的一列显示一个固定值?
- 各位帮帮忙,关于文件路径的正则表达式
- asp.net导出excel 打开提示格式不一致
- 有人用过Pjax吗?
- 请问哪里有NET 3.5+VB.NET的论坛程序可以下载?
- 如何在datagrid的ItemDataBound事件中访问其DataSource的当前行的并且不在列中显示的Column的值?
- ASP.NET页面刷新问题,点击按钮处理完事情后,但界面没有改变,一定要按刷新才可以看到结果,怎么解决?
- 后台插入数据,前台及时显示问题?
- datalist 显示的数据过多 ,加载慢,怎么处理一下
- Application cache failed
求大神帮忙啊