private void BindForSearch() { if (canManageUsers) { if (ipSearchText.Length > 0) { siteUserPage = SiteUser.GetByIPAddress(siteSettings.SiteGuid, ipSearchText); } else { // admins can also search against email address siteUserPage = SiteUser.GetUserAdminSearchPage( siteSettings.SiteId, pageNumber, pageSize, searchText, sortMode, out totalPages ); } } else { siteUserPage = SiteUser.GetUserSearchPage( siteSettings.SiteId, pageNumber, pageSize, searchText, sortMode, out totalPages ); } }
private void BindForSearch() { if (canManageUsers) { if (ipSearchText.Length > 0) { siteUserPage = SiteUser.GetByIPAddress(siteSettings.SiteGuid, ipSearchText); } else { // admins can also search against email address siteUserPage = SiteUser.GetUserAdminSearchPage( siteSettings.SiteId, pageNumber, pageSize, searchText, sortMode, out totalPages); } } else { siteUserPage = SiteUser.GetUserSearchPage( siteSettings.SiteId, pageNumber, pageSize, searchText, sortMode, out totalPages); } //if (searchText.Length > 0) //{ // txtSearchUser.Text = Server.HtmlEncode(searchText); //} //AddAlphaPagerLinks(); //string pageUrl = SiteRoot // + "/MemberList.aspx?" // + "search=" + Server.UrlEncode(Server.HtmlEncode(searchText)) // + "&pagenumber={0}" // +"&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 BindForSearch() { List <SiteUser> siteUserPage; if (canManageUsers) { // admins can also search against email address siteUserPage = SiteUser.GetUserAdminSearchPage( siteSettings.SiteId, pageNumber, pageSize, searchText, sortMode, out totalPages); } else { siteUserPage = SiteUser.GetUserSearchPage( siteSettings.SiteId, pageNumber, pageSize, searchText, sortMode, out totalPages); } if (pageNumber > totalPages) { pageNumber = 1; } if (searchText.Length > 0) { txtSearchUser.Text = Server.HtmlEncode(searchText); } AddAlphaPagerLinks(); string pageUrl = SiteRoot + "/MemberList.aspx?" + "search=" + Server.UrlEncode(Server.HtmlEncode(searchText)) + "&pagenumber={0}" + "&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 BindForSearch() { List <SiteUser> siteUserPage; if (WebUser.IsAdmin) { // admins can also search against email address siteUserPage = SiteUser.GetUserAdminSearchPage( siteSettings.SiteId, pageNumber, pageSize, searchText, out totalPages); } else { siteUserPage = SiteUser.GetUserSearchPage( siteSettings.SiteId, pageNumber, pageSize, searchText, out totalPages); } if (pageNumber > totalPages) { pageNumber = 1; } if (searchText.Length > 0) { txtSearchUser.Text = Server.HtmlEncode(searchText); } 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?" + "search=" + Server.UrlEncode(Server.HtmlEncode(searchText)) + "&pagenumber={0}"; pgrMembers.PageURLFormat = pageUrl; pgrMembers.ShowFirstLast = true; pgrMembers.CurrentIndex = pageNumber; pgrMembers.PageSize = pageSize; pgrMembers.PageCount = totalPages; pgrMembers.Visible = (totalPages > 1); rptUsers.DataSource = siteUserPage; rptUsers.DataBind(); }