{"id":780,"date":"2008-12-23T15:48:08","date_gmt":"2008-12-23T20:48:08","guid":{"rendered":"http:\/\/blogs.devhorizon.com\/reza\/?p=780"},"modified":"2008-12-31T00:24:01","modified_gmt":"2008-12-31T05:24:01","slug":"paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression","status":"publish","type":"post","link":"https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/","title":{"rendered":"Paginating through Your Membership Users"},"content":{"rendered":"<p>Almost a year ago, I wrote a <a href=\"https:\/\/blogs.devhorizon.com\/reza\/?p=486\">post<\/a> explaining how CTE (Common Table Expressions) can make your life much easier when working with your membership users in chunks and pages in SharePoint (or ASP.NET). Well, since then I have received couple emails from people asking for the UI part of that post (SPGridView) so I decided to write another follow up post here to demonstrate how to use <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/microsoft.sharepoint.webcontrols.spgridview.aspx\">SPGridView<\/a>,\u00a0 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/microsoft.sharepoint.webcontrols.spgridviewpager.aspx\">SPGridViewPager<\/a> and <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms190766(SQL.90).aspx\">Common Table Expression<\/a> to achieve a true pagination through your membership users.<\/p>\n<p>Well, We all know that pagination has been always a very common feature when displaying and working with data in an application. The GridView control in ASP.NET 2.0 (my Swiss army control to display and work with data) offers a great support for standard paging with small data sets but when it comes to larger sets of data, things can get a bit funky (It pulls all the data back to the client by default). Back in good old ASP.NET 1.1 days, DataGrid control used to expose a property called VirtualItemCount that defines the number of records\/items when custom paging is used. Unfortunately, this is missing in the GridView control!<\/p>\n<p><!--more--><\/p>\n<p>In SharePoint, the SPGridView control inherits from the ASP.NET GridView control . The SPGridView control comes with some SharePoint flavors by a fairly good integration with the cascading style sheets that are built into WSS 3.0 . If you cruise around SharePoint application pages, you will soon realize that the SPGridView is heavily used in many application pages and Web Parts.  Due to its parent&#8217;s funky behavior in pulling back the whole dataset, the SPGridView also offers the same limitations. Browsing on the web you can find various alternatives for simulating the VirtualItemCount behavior in the GridView, Here are couple of them:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.codeproject.com\/KB\/aspnet\/Custom_Paging_GridView.aspx\">Solution1<\/a>: Use SelectCountMethod in ObjectDataSource to return the virtual item count, which the GridView will use for setting up its pagination. This solution works only if your datasource is an ObjectDataSource.  You can see this solution POCed here in my <a href=\"http:\/\/www.codeplex.com\/threetierwss\">codeplex<\/a> project.<\/li>\n<li>Solution2 (<a href=\"http:\/\/ketulpatel.wordpress.com\/2008\/06\/06\/custom-paging-in-spgridview-extending-spgridviewpager\/\">here <\/a>and <a href=\"http:\/\/blogs.msdn.com\/powlo\/archive\/2007\/03\/23\/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx\">here<\/a>):  Provide a Custom Pager where you will create your own page navigation controls, handle all the events and deal with the display.<\/li>\n<\/ul>\n<p>The alternative I&#8217;ve selected is the second one; create a Custom Pager that extends the control SharePoint provides for pagination called SPGridViewPager (OOTB style pagination).<\/p>\n<p>Let&#8217;s see first the sample code for extending the SPGridViewPager control.<\/p>\n<p>[CSharp]<br \/>\nusing Microsoft.SharePoint.WebControls;<\/p>\n<p>namespace SharePoint.MembershipControls.WebControls<br \/>\n{<br \/>\n    public class CustomPager : SPGridViewPager<br \/>\n    {<br \/>\n        protected int _virtualItemCount;<\/p>\n<p>        public int VirtualItemCount<br \/>\n        {<br \/>\n            get<br \/>\n            {<br \/>\n                return this._virtualItemCount;<br \/>\n            }<br \/>\n            set<br \/>\n            {<br \/>\n                this._virtualItemCount = value;<br \/>\n            }<br \/>\n        }<\/p>\n<p>        public int PageIndex<br \/>\n        {<br \/>\n            get<br \/>\n            {<br \/>\n                return (this.ViewState[&#8220;PageIndex&#8221;] != null ? (int)this.ViewState[&#8220;PageIndex&#8221;] : 0);<br \/>\n            }<br \/>\n            set<br \/>\n            {<br \/>\n                this.ViewState[&#8220;PageIndex&#8221;] = value;<br \/>\n            }<br \/>\n        }<\/p>\n<p>        protected override void Render(System.Web.UI.HtmlTextWriter output)<br \/>\n        {<br \/>\n            if ((this.GridViewControl != null) &#038;&#038; (this.PreviousPageLinkIsEnabled || this.NextPageLinkIsEnabled))<br \/>\n            {<br \/>\n                \/\/ Previous Page<br \/>\n                this.RenderImage(output, this.PreviousPageLinkIsEnabled, &#8220;previouspage&#8221;, &#8220;\/_layouts\/images\/prev.gif&#8221;, &#8220;\/_layouts\/images\/blank.gif&#8221;, &#8220;Previous Page&#8221;);<\/p>\n<p>                \/\/ Records Range<br \/>\n                output.AddAttribute(&#8220;class&#8221;, &#8220;ms-listheaderlabel&#8221;);<br \/>\n                output.RenderBeginTag(&#8220;font&#8221;);<br \/>\n                output.Write(string.Format(&#8220;{0}-{1}&#8221;, ((this.PageIndex * this.GridViewControl.PageSize) + 1), ((this.PageIndex + 1) * this.GridViewControl.PageSize)));<br \/>\n                output.RenderEndTag();<\/p>\n<p>                \/\/ Next Page<br \/>\n                this.RenderImage(output, this.NextPageLinkIsEnabled, &#8220;nextpage&#8221;, &#8220;\/_layouts\/images\/next.gif&#8221;, &#8220;\/_layouts\/images\/blank.gif&#8221;, &#8220;Next Page&#8221;);<br \/>\n            }<br \/>\n        }<\/p>\n<p>        protected override void OnClickPrevious(System.EventArgs args)<br \/>\n        {<br \/>\n            this.PageIndex&#8211;;<br \/>\n            this.GridViewControl.PageIndex = 1;<br \/>\n            base.OnClickPrevious(args);<br \/>\n        }<\/p>\n<p>        protected override void OnClickNext(System.EventArgs args)<br \/>\n        {<br \/>\n            this.PageIndex++;<br \/>\n            this.GridViewControl.PageIndex = 0;<br \/>\n            base.OnClickNext(args);<br \/>\n        }<\/p>\n<p>        private bool PreviousPageLinkIsEnabled<br \/>\n        {<br \/>\n            get<br \/>\n            {<br \/>\n                if (this.GridViewControl != null)<br \/>\n                {<br \/>\n                    if (this.PageIndex > 0)<br \/>\n                    {<br \/>\n                        return true;<br \/>\n                    }<br \/>\n                }<br \/>\n                return false;<br \/>\n            }<br \/>\n        }<\/p>\n<p>        private bool NextPageLinkIsEnabled<br \/>\n        {<br \/>\n            get<br \/>\n            {<br \/>\n                if (this.GridViewControl != null)<br \/>\n                {<br \/>\n                    if (this.PageIndex < (this.PageCount - 1))\n                    {\n                        return true;\n                    }\n                }\n                return false;\n            }\n        }\n\n        private int PageCount\n        {\n            get\n            {\n                return (int)(this._virtualItemCount \/ this.GridViewControl.PageSize) + 1;\n            }\n        }\n\n        private void RenderImage(System.Web.UI.HtmlTextWriter output, bool isEnabled, string postbackEventArgument, string enabledImageUrl, string disabledImageUrl, string toolTip)\n        {\n            string str = disabledImageUrl;\n            if (isEnabled)\n            {\n                output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Href, \"#\");\n                output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Onclick, this.Page.ClientScript.GetPostBackEventReference(this, postbackEventArgument) + \"; return false;\");\n                output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.A);\n                str = enabledImageUrl;\n            }\n            output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Src, str);\n            output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Border, \"0\");\n            output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Alt, toolTip);\n            output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Img);\n            output.RenderEndTag();\n            if (isEnabled)\n            {\n                output.RenderEndTag();\n            }\n        }\n    }\n}\n[\/CSharp]\n\nThe following code demonstrates how to integrate the CustomPager web control in an application page:\n\nASPX page:\n\n[Xml]\n   <%@ Register TagPrefix=\"wssawc\" Namespace=\"Microsoft.SharePoint.WebControls\" Assembly=\"Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c\" %><br \/>\n   <%@ Register TagPrefix=\"wssawc\" Namespace=\"Controls.WebControls\" Assembly=\"Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=388cedd2af9642c2\" %><br \/>\n      <wssawc:SPGridView ID=\"MemberGrid\" AutoGenerateColumns=\"false\"\n                    CssClass=\"ms-vb2\" GridLines=\"None\" HeaderStyle-HorizontalAlign=\"Left\" runat=\"server\" AllowPaging=\"true\" PageSize=\"15\" ><\/p>\n<p>                    <Columns><br \/>\n                        <wssawc:SPBoundField DataField=\"Username\" HeaderText=\"Username\" ><br \/>\n                            <HeaderStyle Width=\"200px\" \/><br \/>\n                        <\/wssawc:SPBoundField><br \/>\n                        <wssawc:SPBoundField DataField=\"Email\" HeaderText=\"E-mail\" ><br \/>\n                            <HeaderStyle Width=\"200px\" \/><br \/>\n                        <\/wssawc:SPBoundField><br \/>\n                    <\/Columns><\/p>\n<p>                <\/wssawc:SPGridView><\/p>\n<p>                <wssawc:CustomPager GridViewId=\"MemberGrid\" runat=\"server\" OnClickNext=\"MemberGrid_ClickNext\" OnClickPrevious=\"MemberGrid_ClickPrevious\" ><br \/>\n                <\/wssawc:CustomPager><br \/>\n[\/Xml]<\/p>\n<p>Here is the Code Behind of the page above:<\/p>\n<p>[CSharp]<br \/>\nusing Microsoft.SharePoint.WebControls;<br \/>\nusing Controls.WebControls;<\/p>\n<p>        protected SPGridView MemberGrid;<br \/>\n        protected CustomPager MemberGridViewPager;<\/p>\n<p>        protected void MemberGrid_ClickNext(Object sender, EventArgs e)<br \/>\n        {<br \/>\n            FillGrid();<br \/>\n        }<\/p>\n<p>        protected void MemberGrid_ClickPrevious(Object sender, EventArgs e)<br \/>\n        {<br \/>\n            FillGrid();<br \/>\n        }<\/p>\n<p>        protected void FillGrid()<br \/>\n        {<br \/>\n            MembershipUserCollection users = new MembershipUserCollection();<br \/>\n            int totalUsers;<\/p>\n<p>            CustomMembershipProvider customProvider = Membership.Provider as CustomMembershipProvider;<br \/>\n            users = customProvider.GetAllUsers(MemberGridViewPager.PageIndex, MemberGrid.PageSize, out totalUsers);<br \/>\n            MemberGridViewPager.VirtualItemCount = totalUsers;<\/p>\n<p>            MemberGrid.DataSource = users;<br \/>\n            MemberGrid.DataBind();<br \/>\n        }<\/p>\n<p>[\/CSharp]<\/p>\n<p>The following code demonstrates how to integrate the CustomPager web control in a web part:<\/p>\n<p>[CSharp]<br \/>\nusing System;<br \/>\nusing System.Web;<br \/>\nusing System.Web.UI;<br \/>\nusing System.Web.UI.WebControls;<br \/>\nusing System.Web.Security;<br \/>\nusing Microsoft.SharePoint.WebControls;<\/p>\n<p>namespace SharePoint.MembershipControls.WebParts<br \/>\n{<br \/>\n    public class MemberList : System.Web.UI.WebControls.WebParts.WebPart<br \/>\n    {<\/p>\n<p>        SPGridView gridView;<br \/>\n        CustomPager customPager;<\/p>\n<p>        protected override void CreateChildControls()<br \/>\n        {<br \/>\n            base.CreateChildControls();<\/p>\n<p>            \/\/<br \/>\n            \/\/ SPGridView<br \/>\n            \/\/<\/p>\n<p>            this.gridView = new SPGridView();<br \/>\n            this.gridView.ID = &#8220;MemberGrid&#8221;;<br \/>\n            this.gridView.AutoGenerateColumns = false;<br \/>\n            this.gridView.CssClass = &#8220;ms-vb2&#8221;;<br \/>\n            this.gridView.GridLines = GridLines.None;<br \/>\n            this.gridView.AllowPaging = true;<br \/>\n            this.gridView.PageSize = 15;<\/p>\n<p>            \/\/ Columns<br \/>\n            BoundField boundField;<\/p>\n<p>            boundField = new BoundField();<br \/>\n            boundField.DataField = &#8220;Username&#8221;;<br \/>\n            boundField.HeaderText = &#8220;Username&#8221;;<br \/>\n            boundField.HeaderStyle.Width = new Unit(200, UnitType.Pixel);<br \/>\n            this.gridView.Columns.Add(boundField);<\/p>\n<p>            boundField = new BoundField();<br \/>\n            boundField.DataField = &#8220;Email&#8221;;<br \/>\n            boundField.HeaderText = &#8220;E-mail&#8221;;<br \/>\n            boundField.HeaderStyle.Width = new Unit(200, UnitType.Pixel);<br \/>\n            this.gridView.Columns.Add(boundField);<\/p>\n<p>            this.Controls.Add(this.gridView);<\/p>\n<p>            \/\/<br \/>\n            \/\/ CustomPager<br \/>\n            \/\/<\/p>\n<p>            this.customPager = new CustomPager();<br \/>\n            this.customPager.ID = &#8220;MemberGridViewPager&#8221;;<br \/>\n            this.customPager.GridViewId = this.gridView.ID;<br \/>\n            this.customPager.ClickPrevious += new EventHandler(MemberGrid_ClickPrevious);<br \/>\n            this.customPager.ClickNext += new EventHandler(MemberGrid_ClickNext);<\/p>\n<p>            this.Controls.Add(this.customPager);<\/p>\n<p>            \/\/ MemberGrid Databind<br \/>\n            this.FillGrid();<br \/>\n        }<\/p>\n<p>        void MemberGrid_ClickPrevious(Object sender, EventArgs e)<br \/>\n        {<br \/>\n            FillGrid();<br \/>\n        }<\/p>\n<p>        void MemberGrid_ClickNext(Object sender, EventArgs e)<br \/>\n        {<br \/>\n            FillGrid();<\/p>\n<p>        }<\/p>\n<p>        void FillGrid()<br \/>\n        {<br \/>\n            MembershipUserCollection users = new MembershipUserCollection();<br \/>\n            CustomMembershipProvider customProvider = Membership.Provider as CustomMembershipProvider;<br \/>\n            int totalUsers;<\/p>\n<p>            users = customProvider.GetAllUsers(this.customPager.PageIndex, this.gridView.PageSize, out totalUsers);<br \/>\n            this.customPager.VirtualItemCount = totalUsers;<\/p>\n<p>            this.gridView.DataSource = users;<br \/>\n            this.gridView.DataBind();<br \/>\n        }<br \/>\n    }<br \/>\n}<br \/>\n[\/CSharp]<\/p>\n<p>SPGridView listing backend users:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blogs.devhorizon.com\/reza\/wp-content\/uploads\/2008\/12\/122308-2047-paginatingt1.png\" \/><\/p>\n<p>As you can tell, CustomPager  control only supports SharePoint OOTB pagination style, it could be extended for supporting other styles.<strong><br \/>\n<\/strong><\/p>\n<p>For retrieving the data displayed on the grid a custom Membership Provider was used. The GetAllUsers method of that provider executes a stored procedure by passing page index and page size parameters. The stored procedure logic uses these values for returning only the rows that corresponds to the page the user is seeing. Here is an example of how to implement that stored procedure using CTE technique (<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms190766(SQL.90).aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/ms190766(SQL.90).aspx<\/a>):<strong><br \/>\n<\/strong><\/p>\n<p>[Sql]<br \/>\nCREATE PROCEDURE [dbo].[sharepoint_sp_getUsers]<br \/>\n(<br \/>\n@pageIndex AS INTEGER,<br \/>\n@pageSize AS INTEGER<br \/>\n)<br \/>\nAS<\/p>\n<p>SET NOCOUNT ON<\/p>\n<p>&#8212; Set the page bounds<br \/>\nDECLARE @PageLowerBound AS INT<br \/>\nDECLARE @PageUpperBound AS INT<\/p>\n<p>SET @PageLowerBound = @PageSize * @PageIndex + 1<br \/>\nSET @PageUpperBound = @PageSize + @PageLowerBound &#8211; 1<\/p>\n<p>&#8212; Get records based on criteria, one page only<br \/>\nWITH ContactsCTE AS<br \/>\n(<br \/>\nSELECT<br \/>\nROW_NUMBER() OVER (ORDER BY UserName) AS RowNum,<br \/>\nCOUNT(*) OVER () AS TotalRows,<br \/>\nEmail,<br \/>\nUserName<br \/>\nFROM<br \/>\ndbo.contact con<br \/>\n)<br \/>\nSELECT<br \/>\ncon.*<br \/>\nFROM<br \/>\nContactsCTE con<br \/>\nWHERE<br \/>\ncon.RowNum BETWEEN @PageLowerBound AND @PageUpperBound<\/p>\n<p>SET NOCOUNT OFF<br \/>\n[\/Sql]<\/p>\n<p>First time the grid is loaded:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blogs.devhorizon.com\/reza\/wp-content\/uploads\/2008\/12\/122308-2047-paginatingt2.png\" \/><\/p>\n<p>When clicking on the next arrow for displaying second page:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blogs.devhorizon.com\/reza\/wp-content\/uploads\/2008\/12\/122308-2047-paginatingt3.png\" \/><\/p>\n<p>There you go, you have successfully managed\u00a0 to land your memebrship users onto your SharePoint page and more importantly paginate through them efficiently to save the bandwidth.<\/p>\n<p>Special thanks goes to my colleague, Diego Altmann for helping out on writing this lengthy blog post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Almost a year ago, I wrote a post explaining how CTE (Common Table Expressions) can make your life much easier when working with your membership users in chunks and pages in SharePoint (or ASP.NET). Well, since then I have received couple emails from people asking for the UI part of that post (SPGridView) so I [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[22],"class_list":["post-780","post","type-post","status-publish","format-standard","hentry","category-moss-2007","tag-membership"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Paginating through Your Membership Users - Reza Alirezaei&#039;s Blog %<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Reza Alirezaei\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/12\\\/23\\\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/12\\\/23\\\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\\\/\"},\"author\":{\"name\":\"Reza Alirezaei\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\"},\"headline\":\"Paginating through Your Membership Users\",\"datePublished\":\"2008-12-23T20:48:08+00:00\",\"dateModified\":\"2008-12-31T05:24:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/12\\\/23\\\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\\\/\"},\"wordCount\":1266,\"commentCount\":2,\"image\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/12\\\/23\\\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/wp-content\\\/uploads\\\/2008\\\/12\\\/122308-2047-paginatingt1.png\",\"keywords\":[\"Membership\"],\"articleSection\":[\"MOSS 2007\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/12\\\/23\\\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/12\\\/23\\\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\\\/\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/12\\\/23\\\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\\\/\",\"name\":\"Paginating through Your Membership Users - Reza Alirezaei's Blog %\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/12\\\/23\\\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/12\\\/23\\\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/wp-content\\\/uploads\\\/2008\\\/12\\\/122308-2047-paginatingt1.png\",\"datePublished\":\"2008-12-23T20:48:08+00:00\",\"dateModified\":\"2008-12-31T05:24:01+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/12\\\/23\\\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/12\\\/23\\\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/wp-content\\\/uploads\\\/2008\\\/12\\\/122308-2047-paginatingt1.png\",\"contentUrl\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/wp-content\\\/uploads\\\/2008\\\/12\\\/122308-2047-paginatingt1.png\",\"width\":628,\"height\":301},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#website\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/\",\"name\":\"Reza Alirezaei's Blog\",\"description\":\"Blogging from the field!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\",\"name\":\"Reza Alirezaei\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"caption\":\"Reza Alirezaei\"},\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/author\\\/rezaa\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Paginating through Your Membership Users - Reza Alirezaei's Blog %","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/","twitter_misc":{"Written by":"Reza Alirezaei","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/#article","isPartOf":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/"},"author":{"name":"Reza Alirezaei","@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938"},"headline":"Paginating through Your Membership Users","datePublished":"2008-12-23T20:48:08+00:00","dateModified":"2008-12-31T05:24:01+00:00","mainEntityOfPage":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/"},"wordCount":1266,"commentCount":2,"image":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/#primaryimage"},"thumbnailUrl":"https:\/\/blogs.devhorizon.com\/reza\/wp-content\/uploads\/2008\/12\/122308-2047-paginatingt1.png","keywords":["Membership"],"articleSection":["MOSS 2007"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/","url":"https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/","name":"Paginating through Your Membership Users - Reza Alirezaei's Blog %","isPartOf":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/#primaryimage"},"image":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/#primaryimage"},"thumbnailUrl":"https:\/\/blogs.devhorizon.com\/reza\/wp-content\/uploads\/2008\/12\/122308-2047-paginatingt1.png","datePublished":"2008-12-23T20:48:08+00:00","dateModified":"2008-12-31T05:24:01+00:00","author":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/12\/23\/paginating-through-your-membership-users-using-spgridview-spgridviewpager-and-common-table-expression\/#primaryimage","url":"https:\/\/blogs.devhorizon.com\/reza\/wp-content\/uploads\/2008\/12\/122308-2047-paginatingt1.png","contentUrl":"https:\/\/blogs.devhorizon.com\/reza\/wp-content\/uploads\/2008\/12\/122308-2047-paginatingt1.png","width":628,"height":301},{"@type":"WebSite","@id":"https:\/\/blogs.devhorizon.com\/reza\/#website","url":"https:\/\/blogs.devhorizon.com\/reza\/","name":"Reza Alirezaei's Blog","description":"Blogging from the field!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blogs.devhorizon.com\/reza\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938","name":"Reza Alirezaei","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","caption":"Reza Alirezaei"},"url":"https:\/\/blogs.devhorizon.com\/reza\/author\/rezaa\/"}]}},"_links":{"self":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/780","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/comments?post=780"}],"version-history":[{"count":0,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/780\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/media?parent=780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/categories?post=780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/tags?post=780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}