internal static string BuildJsonPagerInfo(string firstLinkFormat,string linkFormat, int pageIndex, int recordCount, int pages) { var pagingGetter = new CustomPagingGetter(firstLinkFormat, linkFormat, "", "", "<<", ">>"); UrlPager pg = UrlPaging.NewPager(pageIndex,pages,pagingGetter); pg.RecordCount = recordCount; pg.LinkCount = 10; pg.PagerTotal="共{2}条"; return pg.Pager(); }
static DefaultPageingGetter() { getter = new CustomPagingGetter( "", "?page=%d", "第一页", "最末页", "上一页", "下一页" ); }
/// <summary> /// 创建分页信息 /// </summary> /// <param name="pageSize"></param> /// <param name="currentPageIndex"></param> /// <param name="recordCount"></param> /// <param name="pageCount"></param> /// <returns></returns> public static string PagerHtml(string firstFormat, string format, int currentPageIndex, int recordCount, int pageCount) { IPagingGetter pg = new CustomPagingGetter( firstFormat, format, "第一页", "最末页", "<<上一页", ">>下一页" ); UrlPager p = NewPager(currentPageIndex, pageCount, pg); // p.PreviousPageText = "<<"; // p.NextPageText = ">>"; p.EnableInput = true; p.SelectPageText = "跳页"; p.PagerTotal = String.Empty; p.RecordCount = recordCount; p.PagerTotal = String.Empty; return(p.Pager()); }
/// <summary> /// 设置分页 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageCount"></param> /// <param name="recordCount"></param> /// <param name="firstLink"></param> /// <param name="link"></param> public virtual void SetPager(int pageIndex, int pageCount, int recordCount, string firstLink, string link) { //string pagerPack = ""; //switch (this.site.Language) //{ // default: // case Languages.En_US: // pagerPack = en_us_pack; break; // case Languages.Zh_CN: // pagerPack = zh_cn_pack; break; // case Languages.Zh_TW: // pagerPack = zh_tw_pack; break; //} //string[] pagerLangs = pagerPack.Split('|'); // const string pagerTpl = "<div class=\"pager\">{0}</div>"; IPagingGetter getter = new CustomPagingGetter( firstLink, link, AtNet.Cms.Cms.Language.Get(LanguagePackageKey.PAGER_PrePageText), AtNet.Cms.Cms.Language.Get(LanguagePackageKey.PAGER_NextPageText), AtNet.Cms.Cms.Language.Get(LanguagePackageKey.PAGER_PrePageText), AtNet.Cms.Cms.Language.Get(LanguagePackageKey.PAGER_NextPageText) ); UrlPager p = UrlPaging.NewPager(pageIndex, pageCount, getter); p.LinkCount = 10; p.PagerTotal = "<span class=\"pagerinfo\">" + AtNet.Cms.Cms.Language.Get(LanguagePackageKey.PAGER_PagerTotal) + "</span>"; p.RecordCount = recordCount; /* StringBuilder sb = new StringBuilder(); sb.Append("<div class=\"pager\">"); p.RecordCount = recordCount; p.FirstPageLink = firstLink; p.LinkFormat = link; p.PreviousPageText = Cms.Language.Get(LanguagePackageKey.PAGER_PrePageText); p.NextPageText = Cms.Language.Get(LanguagePackageKey.PAGER_NextPageText); p.PageTextFormat = "{0}"; p.SelectPageText = Cms.Language.Get(LanguagePackageKey.PAGER_SelectPageText); p.Style = PagerStyle.Custom; p.EnableSelect = true; p.PagerTotal = Cms.Language.Get(LanguagePackageKey.PAGER_PagerTotal); p.LinkCount = 10;*/ string key = this.PushPagerKey(); AtNet.Cms.Cms.Context.Items[key] = p.Pager(); // String.Format(pagerTpl, p.ToString()); }
/// <summary> /// 创建分页信息 /// </summary> /// <param name="pageSize"></param> /// <param name="currentPageIndex"></param> /// <param name="recordCount"></param> /// <param name="pageCount"></param> /// <returns></returns> public static string PagerHtml(string firstFormat, string format, int currentPageIndex, int recordCount, int pageCount) { IPagingGetter pg = new CustomPagingGetter( firstFormat, format, "第一页", "最末页", "<<上一页", ">>下一页" ); UrlPager p = NewPager(currentPageIndex, pageCount, pg); // p.PreviousPageText = "<<"; // p.NextPageText = ">>"; p.EnableInput = true; p.SelectPageText = "跳页"; p.PagerTotal = String.Empty; p.RecordCount = recordCount; p.PagerTotal = String.Empty; return p.Pager(); }