Exemple #1
0
        // 添加“第一页”,“上一页”的连接
        private void AddPreviousLink(UrlManager urlManager)
        {
            PageLink first = new PageLink();
            first.Css = "PagerIcon";
            first.Text = "<<";
            first.Url = urlManager.GetPageUrl(1);
            AddLinkToPagerString(first);

            PageLink previous = new PageLink();
            previous.Css = "PagerIcon";
            previous.Text = "<";
            previous.Url = urlManager.GetPageUrl(currentPage - 1);
            AddLinkToPagerString(previous);

            showPrevious = false;	// 只显示一次
        }
Exemple #2
0
        // 添加 “下一页”、“最末页” 的链接
        private void AddNextLink(UrlManager urlManager)
        {
            PageLink next = new PageLink();
            next.Css = "PagerIcon";
            next.Text = ">";
            next.Url = urlManager.GetPageUrl(currentPage + 1);
            AddLinkToPagerString(next);

            PageLink last = new PageLink();
            last.Css = "PagerIcon";
            last.Text = ">>";
            last.Url = urlManager.GetPageUrl(pageCount);
            AddLinkToPagerString(last);

            showNext = false;	// 可有可无,程序会跳出循环
        }