- 类:
- 属性:
- 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
- 方法:
- 事件:
UrlPager 示例 - 基本功能
本示例演示UrlPager的最基本功能。
PageChanged event fired, current page index is 12
路由定义:
routes.MapPageRoute("UrlPager_Basic", "urlpager/demos/{controller}/{action}/{id}", "~/UrlPager/Demos/Basic.aspx", false, new RouteValueDictionary { { "controller", "Basic" }, { "action", "page" }, { "id", null } }, new RouteValueDictionary { { "controller", "Basic" }, { "action", "page" } });
Basic.aspx:
<%@Register Namespace="Webdiyer.WebControls" Assembly="Webdiyer.UrlPager" TagPrefix="webdiyer"%> <div><asp:Label runat="server" ID="lb_txt" EnableViewState="false"></asp:Label> <asp:Label runat="server" ID="lb_btn" EnableViewState="false"></asp:Label> </div> <webdiyer:UrlPager runat="server" id="pager1" RouteName="UrlPager_Basic" PageIndexParameterName="id" InheritsRouteValues="true" PagerItemTemplate=" {0}" TotalItemCount="198" OnPageChanged="PageChanged"></webdiyer:UrlPager>
Basic.aspx.cs:
using System; namespace Webdiyer.UrlPagerDemo { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void PageChanged(object sender, EventArgs e) { lb_txt.Text = "PageChanged event fired, current page index is " + pager1.CurrentPageIndex; } } }