zoukankan      html  css  js  c++  java
  • ListView搭配DataPager控件实现分页笔记

    ListView搭配DataPager控件实现分页


    实现了IPageableItemContainer接口的控件可以使用DataPager进行分页
    但是ASP.NET中目前只有ListView实现了这个接口


    ①将DataPager声明到ListView中来用,在LayoutTemplate中
    在ListView的配置中就启用分页,会自动在LayoutTemplate中会生成相应的代码、


    ②单独地声明DataPager
    设置PagedControlID来关联相应的ListView


       <Fields>
                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                        ShowNextPageButton="False" ShowPreviousPageButton="False" />
                    <asp:NumericPagerField />
                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                        ShowNextPageButton="False" ShowPreviousPageButton="False" />
                </Fields>
    显示风格由Fields中的字段设置
    可以放置多个字段
    NextPreviousPagerField(上一页、下一页、首页、末页)
    NumericPagerField(数字页)
    TemplatePagerField 用模板自定义


    First第一
    Next下一个
    last最后
    Previous上一个


    ButtonCssClass:按钮的样式
    ButtonType:按钮的形式----Button、Link、Image图片


    FirstPageImageUrl  按钮图片的地址
    FirstPageText  按钮文本
    ShowFirstButton  是否显示第一页按钮


    数字形式中显示数字的个数:ButtonCount




    QueryStringField ---- id
    http://localhost:50214/list.aspx?page=2

    本博客(liqipeng)除非已明确说明转载,否则皆为liqipeng原创或者整理,转载请保留此链接:https://www.cnblogs.com/liqipeng/archive/2012/07/18/4576204.html

    本博客(liqipeng)除非已明确说明转载,否则皆为liqipeng原创或者整理,转载请保留此链接:https://www.cnblogs.com/liqipeng/archive/2012/07/18/4576204.html
    如果你觉得这篇文章对你有帮助或者使你有所启发,请点击右下角的推荐按钮,谢谢,:)
  • 相关阅读:
    mysql 查看存储过程 并导出
    mysql 添加记录或者删除记录
    mysql 修改表的字段
    搭建docker私有仓库
    安装gitlab并配置邮箱
    Mac 安装MySQL-python
    android studio 调试安装
    给定日期求星期几
    数字三角形
    程序设计实训-课程表管理系统项目中遇到的问题
  • 原文地址:https://www.cnblogs.com/liqipeng/p/4576204.html
Copyright © 2011-2022 走看看