- 类:
- 属性:
- 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在回发后保持当前页状态的功能。
Route definition:
routes.MapPageRoute("UrlPager_Postback", "urlpager/demos/{controller}/{pageIndex}", "~/UrlPager/Demos/Postback.aspx", false, new RouteValueDictionary { { "controller", "Postback" }, { "pageIndex", null } }, new RouteValueDictionary { { "controller", "Postback" } });
Postback.aspx:
<%@Register Namespace="Webdiyer.WebControls" Assembly="Webdiyer.UrlPager" TagPrefix="webdiyer"%> <form runat="server" id="form1"> <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_Postback" InheritsRouteValues="true" PagerItemTemplate=" {0}" TotalItemCount="198" OnPageChanged="PageChanged"> </webdiyer:UrlPager> <asp:Button runat="server" ID="btn_test" Text="Post back test" OnClick="TestClick" /> </form>
Postback.aspx.cs:
using System; namespace Webdiyer.UrlPagerDemo { public partial class Postback : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void TestClick(object sender, EventArgs e) { lb_btn.Text = "Button clicked and page postback event fired"; } protected void PageChanged(object sender, EventArgs e) { lb_txt.Text = "PageChanged event fired, current page index is " + pager1.CurrentPageIndex; } } }