十天学会ASP.net之第九天

来源:互联网 发布:网络传销举报电话 编辑:程序博客网 时间:2024/04/29 19:46
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
.Vii443{display:none;}

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


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

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

 

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

今天就说到这里,明天说一下SESSION和COOKIE。

<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击