- 类:
- 属性:
- AlwaysShowFirstLastPageNumber
- AutoHide
- ContainerTag
- CurrentPageIndex
- CurrentPageNumberFormatString
- CurrentPagerItemTemplate
- DisabledPagerItemTemplate
- EndItemIndex
- FirstPageText
- InheritsRouteValues
- LastPageText
- MorePagerItemTemplate
- MorePageText
- NavigationPagerItemTemplate
- NextPageText
- NumericPagerItemCount
- NumericPagerItemTemplate
- PageIndexParameterName
- PageNumberFormatString
- PagerItemTemplate
- PageSize
- PrevPageText
- ReversePageIndex
- RouteName
- RouteValues
- ShowDisabledPagerItems
- ShowFirstLast
- ShowMorePagerItems
- ShowNumericPagerItems
- ShowPrevNext
- StartItemIndex
- TotalItemCount
- TotalPageCount
- 方法:
- 事件:
PageChanged 事件
C# 语法:
public event EventHandler PageChanged;
示例:
以下示例演示如何编写 PageChanged事件并在事件处理程序中绑定数据:<webdiyer:UrlPager runat="server" id="pager1" RouteName="UrlPager_Repeater" CssClass="pull-right" PageIndexParameterName="id" PagerItemTemplate=" {0}" OnPageChanged="PageChanged"></webdiyer:UrlPager> public partial class Repeater : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) pager1.TotalItemCount = (int)SqlHelper.ExecuteScalar(CommandType.StoredProcedure, "P_GetOrderNumber"); } protected void PageChanged(object sender, EventArgs e) { Repeater1.DataSource = SqlHelper.ExecuteReader(CommandType.StoredProcedure, ConfigurationManager.AppSettings["pagedSPName"], new SqlParameter("@startIndex", pager1.StartItemIndex), new SqlParameter("@endIndex", pager1.EndItemIndex)); Repeater1.DataBind(); } }