All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
十天学会ASP.net,第九天_.net资料_编程技术

Writer: aaa Article type: Programming skills(编程技巧) Time: 2013/12/6 10:39:16 Browse times: 371 Comment times: 0

十天学会ASP.net,第九天_.net资料_编程技术


Head photo

Go homepage
Upload pictures
Write articles

十天学会ASP.net 第九天_.net资料_编程技术-数科优化网


学习目的:学会用DATAGRID分页显示




虽然说DATAGRID的分页显示效率不怎么高,但是不管怎么说,它是最方便的分页显示,对于做一个留言簿还是相当简单实用的。对于启用分页功能还有一个重要要求,只能在DATADRID控件的数据源实现了ICOLLECTION接口的情况下才能启用分页功能,而DATAREADER没有这个接口,所以必须使用DATATABLE来代替。



id="dgrdMain"
cellpadding="1"
showheader="true"
borderwidth="0"
allowpaging="true" 启用分页功能
pagesize="3" 每一页显示三条记录
onpageindexchanged="dgrdMain_pageindexchanged " 调用第×页的函数为dgrdMain_PageIndexChanged()
runat="server"
/>







id="dgrdMain"
cellpadding="1"
showheader="true"
borderwidth="0"
allowpaging="true" 启用分页功能
pagesize="3" 每一页显示三条记录
onpageindexchanged="dgrdMain_pageindexchanged " 调用第×页的函数为dgrdMain_PageIndexChanged()
runat="server"
/>




这样就是最简单的分页,我们可以用参数pagestyle-mode="nextprev/numericpages"来设定是显示上一页、下一页方式还是直接选择页面的数字方式来实现页面跳转。如果是前者我们可以用pagestyle-nextpagetext来设定包含下一页链接的文本,用pagestyle-prevpagetext来设定包含上一页链接的文本;如果是后者我们可以用PagerStyle-PageButtonCount来设定在使用省略号之前显示的页面编号数量(默认是10)
























There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.