- Simple postback
- Show or hide buttons
- Custom info section
- Repeater paging
- DataList paging
- Url paging
- Url rewriting
- Reversing page index
- N tier application
- XML file as data source
- Photo viewer
- AccessDataSource paging
- SqlDataSource paging
- ObjectDataSource paging
- Customized rendering
- Using image buttons
- Search result paging
- Search result url paging
- Clone AspNetPager
- Using page index box
- Customize navigation buttons
- Paging within user control
- UpdatePanel supporting
- CurrentPageButtonPosition
- Using table layout
- Image submit button
- Get page size from url
- Applying css styles
- Using GoToPage method
- PagingButtonLayoutType
- Classes:
- Properties:
- AlwaysShow property
- AlwaysShowFirstLastPageNumber property
- BackImageUrl property
- ButtonImageAlign property
- ButtonImageExtension property
- ButtonImageNameExtension property
- CloneFrom property
- CpiButtonImageNameExtension property
- CssClass property
- CurrentPageButtonClass property
- CurrentPageButtonPosition property
- CurrentPageButtonStyle property
- CurrentPageButtonTextFormatString property
- CurrentPageIndex property
- CustomInfoClass property
- CustomInfoHTML property
- CustomInfoSectionWidth property
- CustomInfoStyle property
- CustomInfoTextAlign property
- DisabledButtonImageNameExtension property
- EnableTheming property
- EnableUrlRewriting property
- EndRecordIndex property
- FirstPageText property
- FirstPageUrlRewritePattern property
- HorizontalAlign property
- ImagePath property
- InvalidPageIndexErrorMessage property
- LastPageText property
- LayoutType property
- MoreButtonType property
- NavigationButtonsPosition property
- NavigationButtonType property
- NavigationToolTipTextFormatString property
- NextPageText property
- NumericButtonCount property
- NumericButtonTextFormatString property
- NumericButtonType property
- PageCount property
- PageIndexBoxClass property
- PageIndexBoxStyle property
- PageIndexBoxType property
- PageIndexOutOfRangeErrorMessage property
- PageSize property
- PagesRemain property
- PagingButtonLayoutType property
- PagingButtonSpacing property
- PagingButtonType property
- PrevPageText property
- RecordCount property
- RecordsRemain property
- ReverseUrlPageIndex property
- ShowBoxThreshold property
- ShowCustomInfoSection property
- ShowDisabledButtons property
- ShowFirstLast property
- ShowMoreButtons property
- ShowNavigationToolTip property
- ShowPageIndex property
- ShowPageIndexBox property
- ShowPrevNext property
- SkinID property
- StartRecordIndex property
- SubmitButtonClass property
- SubmitButtonImageUrl property
- SubmitButtonStyle property
- SubmitButtonText property
- TextAfterPageIndexBox property
- TextBeforePageIndexBox property
- UrlPageIndexName property
- UrlPageSizeName property
- UrlPaging property
- UrlPagingTarget property
- UrlRewritePattern property
- Methods:
- Events:
- Enums:
- Delegates:
AspNetPager demo - Using table layout
This sample demonstrates how to use table layout with the AspNetPager control.
TableLayout.aspx:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="100%" CssClass="table table-bordered"> <Columns> <asp:BoundField DataField="orderid" HeaderText="Order ID" /> <asp:BoundField DataField="orderdate" HeaderText="Order Date" DataFormatString="{0:d}" /> <asp:BoundField DataField="companyname" HeaderText="Company Name" /> <asp:BoundField DataField="employeename" HeaderText="Employee Name" /> </Columns> </asp:GridView> <webdiyer:AspNetPager id="AspNetPager1" runat="server" PagingButtonSpacing="8px" onpagechanged="AspNetPager1_PageChanged" showcustominfosection="Right" CustomInfoHTML="Page:<font color='red'><b>%currentPageIndex%</b></font> of %PageCount%,%PageSize% per page" urlpaging="True" width="100%" LayoutType="Table" ShowNavigationToolTip="true" UrlPageIndexName="pageindex"></webdiyer:AspNetPager>
TableLayout.aspx.cs:
using System; using System.Configuration; using System.Data; using System.Data.SqlClient; public partial class TableLayout_Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //cache the number of total records to improve performance object obj = Cache[GetType() + "totalOrders"]; if (obj == null) { int totalOrders = (int)SqlHelper.ExecuteScalar(CommandType.StoredProcedure, "P_GetOrderNumber"); Cache[GetType() + "totalOrders"] = totalOrders; AspNetPager1.RecordCount = totalOrders; } else { AspNetPager1.RecordCount = (int)obj; } } } protected void AspNetPager1_PageChanged(object src, EventArgs e) { GridView1.DataSource = SqlHelper.ExecuteReader(CommandType.StoredProcedure, ConfigurationManager.AppSettings["pagedSPName"], new SqlParameter("@startIndex", AspNetPager1.StartRecordIndex), new SqlParameter("@endIndex", AspNetPager1.EndRecordIndex)); GridView1.DataBind(); } }