Beispiel #1
0
        private void BindAlphaList()
        {
            siteUserPage = SiteUser.GetPage(
                siteSettings.SiteId,
                pageNumber,
                pageSize,
                filterLetter,
                sortMode,
                sortMode == 2 ? "lastname" : "display",
                out totalPages
                );

            if (pageNumber > totalPages)
            {
                pageNumber   = 1;
                siteUserPage = SiteUser.GetPage(
                    siteSettings.SiteId,
                    pageNumber,
                    pageSize,
                    filterLetter,
                    sortMode,
                    sortMode == 2 ? "lastname" : "display",
                    out totalPages
                    );
            }
        }
Beispiel #2
0
        private void BindAlphaList()
        {
            siteUserPage = SiteUser.GetPage(
                siteSettings.SiteId,
                pageNumber,
                pageSize,
                filterLetter,
                sortMode,
                out totalPages);

            if (pageNumber > totalPages)
            {
                pageNumber   = 1;
                siteUserPage = SiteUser.GetPage(
                    siteSettings.SiteId,
                    pageNumber,
                    pageSize,
                    filterLetter,
                    sortMode,
                    out totalPages);
            }

            //if (userNameBeginsWith.Length > 1)
            //{
            //    txtSearchUser.Text = Server.HtmlEncode(userNameBeginsWith);
            //}

            //AddAlphaPagerLinks();

            //string pageUrl = SiteRoot
            //    + "/MemberList.aspx?"
            //    + "pagenumber={0}"
            //    + "&letter=" + Server.UrlEncode(Server.HtmlEncode(userNameBeginsWith))
            //    + "&sd=" + sortMode.ToInvariantString();

            //pgrMembers.PageURLFormat = pageUrl;
            //pgrMembers.ShowFirstLast = true;
            //pgrMembers.CurrentIndex = pageNumber;
            //pgrMembers.PageSize = pageSize;
            //pgrMembers.PageCount = totalPages;
            //pgrMembers.Visible = (totalPages > 1);


            //rptUsers.DataSource = siteUserPage;
            //rptUsers.DataBind();
        }
        private void BindAlphaList()
        {
            List <SiteUser> siteUserPage = SiteUser.GetPage(
                siteSettings.SiteId,
                pageNumber,
                pageSize,
                userNameBeginsWith,
                out totalPages);

            if (pageNumber > totalPages)
            {
                pageNumber   = 1;
                siteUserPage = SiteUser.GetPage(
                    siteSettings.SiteId,
                    pageNumber,
                    pageSize,
                    userNameBeginsWith,
                    out totalPages);
            }

            if (userNameBeginsWith.Length > 1)
            {
                txtSearchUser.Text = Server.HtmlEncode(userNameBeginsWith);
            }

            Literal topPageLinks = new Literal();
            string  pageUrl      = SiteRoot
                                   + "/MemberList.aspx?"
                                   + "pagenumber=";

            string alphaChars;

            if (WebConfigSettings.GetAlphaPagerCharsFromResourceFile)
            {
                alphaChars = Resource.AlphaPagerChars;
            }
            else
            {
                alphaChars = WebConfigSettings.AlphaPagerChars;
            }

            topPageLinks.Text = UIHelper.GetAlphaPagerLinks(
                pageUrl,
                pageNumber,
                alphaChars,
                userNameBeginsWith);

            this.spnTopPager.Controls.Add(topPageLinks);

            pageUrl = SiteRoot
                      + "/MemberList.aspx?"
                      + "pagenumber={0}"
                      + "&amp;letter=" + Server.UrlEncode(Server.HtmlEncode(userNameBeginsWith));

            pgrMembers.PageURLFormat = pageUrl;
            pgrMembers.ShowFirstLast = true;
            pgrMembers.CurrentIndex  = pageNumber;
            pgrMembers.PageSize      = pageSize;
            pgrMembers.PageCount     = totalPages;
            pgrMembers.Visible       = (totalPages > 1);


            rptUsers.DataSource = siteUserPage;

            rptUsers.DataBind();
        }