- 基本功能
- 分页按钮属性效果
- 使用自定义信息区
- Repeater分页
- DataList分页
- Url分页
- Url重写
- Url逆向分页
- n层结构应用
- 使用Xml文件数据源
- 图片浏览示例
- AccessDataSource分页
- SqlDataSource分页
- ObjectDataSource分页
- 自定义数据呈现逻辑
- 使用图片按钮
- 查询结果分页
- 查询结果Url分页
- 克隆属性及事件
- 页索引输入/选择框
- 自定义导航按钮
- 在用户控件中实现分页
- UpdatePanel支持
- 设置当前页按钮位置
- 使用Table布局
- 自定义提交按钮图片
- 从Url中获取每页显示记录数
- 应用CSS样式
- 使用GoToPage方法
- 分页导航元素布局
- 类:
- 属性:
- AlwaysShow
- AlwaysShowFirstLastPageNumber
- BackImageUrl
- ButtonImageAlign
- ButtonImageExtension
- ButtonImageNameExtension
- CloneFrom
- CpiButtonImageNameExtension
- CssClass
- CurrentPageButtonClass
- CurrentPageButtonPosition
- CurrentPageButtonStyle
- CurrentPageButtonTextFormatString
- CurrentPageIndex
- CustomInfoClass
- CustomInfoHTML
- CustomInfoSectionWidth
- CustomInfoStyle
- CustomInfoTextAlign
- DisabledButtonImageNameExtension
- EnableTheming
- EnableUrlRewriting
- EndRecordIndex
- FirstPageText
- FirstPageUrlRewritePattern
- HorizontalAlign
- ImagePath
- InvalidPageIndexErrorMessage
- LastPageText
- LayoutType
- MoreButtonType
- NavigationButtonsPosition
- NavigationButtonType
- NavigationToolTipTextFormatString
- NextPageText
- NumericButtonCount
- NumericButtonTextFormatString
- NumericButtonType
- PageCount
- PageIndexBoxClass
- PageIndexBoxStyle
- PageIndexBoxType
- PageIndexOutOfRangeErrorMessage
- PageSize
- PagesRemain
- PagingButtonLayoutType
- PagingButtonSpacing
- PagingButtonType
- PrevPageText
- RecordCount
- RecordsRemain
- ReverseUrlPageIndex
- ShowBoxThreshold
- ShowCustomInfoSection
- ShowDisabledButtons
- ShowFirstLast
- ShowMoreButtons
- ShowNavigationToolTip
- ShowPageIndex
- ShowPageIndexBox
- ShowPrevNext
- SkinID
- StartRecordIndex
- SubmitButtonClass
- SubmitButtonImageUrl
- SubmitButtonStyle
- SubmitButtonText
- TextAfterPageIndexBox
- TextBeforePageIndexBox
- UrlPageIndexName
- UrlPageSizeName
- UrlPaging
- UrlPagingTarget
- UrlRewritePattern
- 方法:
- 事件:
- 枚举:
- 委托:
AspNetPager 示例 - 应用CSS样式
该示例演示如何为AspNetPager分页控件定义及应用样式。
ApplyStyles.aspx:
<%@ Page Title="应用CSS样式" MetaDescription="该示例演示如何为AspNetPager分页控件定义及应用样式。" Language="C#" MasterPageFile="AspNetPager.master" AutoEventWireup="true" Inherits="Styles1_Default" Codebehind="ApplyStyles.aspx.cs" %> <asp:Content ID="Content2" ContentPlaceHolderID="main" Runat="Server"> <h4>Bootstrap pagination:</h4> <webdiyer:AspNetPager CssClass="pagination" LayoutType="Ul" PagingButtonLayoutType="UnorderedList" PagingButtonSpacing="0" CurrentPageButtonClass="active" ID="AspNetPager1" runat="server" RecordCount="228"> </webdiyer:AspNetPager> <br /> CSS样式:<br /> <textarea rows="4" style="width:98%">/*先引入bootstrap.css*/ .pagination a[disabled]{ color: #777;cursor: not-allowed;background-color: #fff;border-color: #ddd;} .pagination span.active{z-index: 2;color: #fff;cursor: default;background-color: #337ab7;border-color: #337ab7;}</textarea> <br />属性设置:<span class="code">CssClass="pagination" LayoutType="Ul" PagingButtonLayoutType="UnorderedList" PagingButtonSpacing="0" CurrentPageButtonClass="active"</span> <h4>网易风格:</h4> <webdiyer:AspNetPager CssClass="anpager" CurrentPageButtonClass="cpb" PagingButtonSpacing="0" ID="AspNetPager2" runat="server" RecordCount="228" FirstPageText="首页" LastPageText="尾页" NextPageText="后页" PrevPageText="前页"> </webdiyer:AspNetPager> <br /> CSS样式:<br /> <textarea rows="4" style="width:98%"> .anpager .cpb {background:#1F3A87 none repeat scroll 0 0;border:1px solid #CCCCCC;color:#FFFFFF;font-weight:bold;margin:5px 4px 0 0;padding:4px 5px 0;} .anpager a {background:#FFFFFF none repeat scroll 0 0;border:1px solid #CCCCCC;color:#1F3A87;margin:5px 4px 0 0;padding:4px 5px 0;text-decoration:none} .anpager a:hover{background:#1F3A87 none repeat scroll 0 0;border:1px solid #1F3A87;color:#FFFFFF;}</textarea> <br />属性设置:<span class="code">CssClass="anpager" CurrentPageButtonClass="cpb" PagingButtonSpacing="0"</span> <hr /> <h4>拍拍网风格:</h4> <webdiyer:AspNetPager CssClass="paginator" CurrentPageButtonClass="cpb" PagingButtonSpacing="0" ID="AspNetPager3" runat="server" RecordCount="228" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页"> </webdiyer:AspNetPager> <br />CSS样式:<br /> <textarea rows="4" style="width:98%"> .paginator { font: 11px Arial, Helvetica, sans-serif;padding:10px 20px 10px 0; margin: 0px;} .paginator a {padding: 1px 6px; border: solid 1px #ddd; background: #fff; text-decoration: none;margin-right:2px} .paginator a:visited {padding: 1px 6px; border: solid 1px #ddd; background: #fff; text-decoration: none;} .paginator .cpb {padding: 1px 6px;font-weight: bold; font-size: 13px;border:none} .paginator a:hover {color: #fff; background: #ffa501;border-color:#ffa501;text-decoration: none;}</textarea> <br />属性设置:<span class="code">CssClass="paginator" CurrentPageButtonClass="cpb" PagingButtonSpacing="0"</span> <hr /> <h4>迅雷风格:</h4> <webdiyer:AspNetPager CssClass="pages" CurrentPageButtonClass="cpb" PagingButtonSpacing="0" ID="AspNetPager4" runat="server" RecordCount="228" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页"> </webdiyer:AspNetPager> <br />CSS样式:<br /> <textarea rows="4" style="width:98%"> .pages { color: #999;overflow: auto; } .pages a, .pages .cpb { text-decoration:none;float: left; padding: 0 5px; border: 1px solid #ddd;background: #ffff;margin:0 2px; font-size:11px; color:#000;} .pages a:hover { background-color: #E61636; color:#fff;border:1px solid #E61636; text-decoration:none;} .pages .cpb { font-weight: bold; color: #fff; background: #E61636; border:1px solid #E61636;}</textarea> <br />属性设置:<span class="code">CssClass="pages" CurrentPageButtonClass="cpb" PagingButtonSpacing="0"</span> </asp:Content>
ApplyStyles.aspx.cs:
using System; public partial class Styles1_Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } }