<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Creating a Custom EPiServer Paging Control</title>
	<atom:link href="http://www.frederikvig.com/2009/09/creating-a-custom-episerver-paging-control/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.frederikvig.com/2009/09/creating-a-custom-episerver-paging-control/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=creating-a-custom-episerver-paging-control</link>
	<description></description>
	<lastBuildDate>Sat, 31 Jul 2010 01:46:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Peter</title>
		<link>http://www.frederikvig.com/2009/09/creating-a-custom-episerver-paging-control/comment-page-1/#comment-192</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Wed, 10 Feb 2010 06:33:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.frederikvig.com/?p=224#comment-192</guid>
		<description>How would you go about to make the pager only show 10 pages at a time? E.g. &quot;1 2 3 4 5 6 7 8 9 10 &gt;&quot;, &quot;&quot;. At the moment my pager shows 27 pages with 10 pages on each one of them and my guess is that when these get to about 45 the page listing will continue on outside the graphics and will be unreachable.</description>
		<content:encoded><![CDATA[<p>How would you go about to make the pager only show 10 pages at a time? E.g. &#8220;1 2 3 4 5 6 7 8 9 10 &gt;&#8221;, &#8220;&#8221;. At the moment my pager shows 27 pages with 10 pages on each one of them and my guess is that when these get to about 45 the page listing will continue on outside the graphics and will be unreachable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://www.frederikvig.com/2009/09/creating-a-custom-episerver-paging-control/comment-page-1/#comment-186</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Tue, 02 Feb 2010 09:33:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.frederikvig.com/?p=224#comment-186</guid>
		<description>I totally forgot to follow up on this page so no harm done. I&#039;ve got it working now thanks to your friendly url-support. To start out I did have the same problem as Andrey had but it was easily fixed. Thanks!</description>
		<content:encoded><![CDATA[<p>I totally forgot to follow up on this page so no harm done. I&#8217;ve got it working now thanks to your friendly url-support. To start out I did have the same problem as Andrey had but it was easily fixed. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Øyvind</title>
		<link>http://www.frederikvig.com/2009/09/creating-a-custom-episerver-paging-control/comment-page-1/#comment-179</link>
		<dc:creator>Øyvind</dc:creator>
		<pubDate>Fri, 29 Jan 2010 11:34:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.frederikvig.com/?p=224#comment-179</guid>
		<description>Thanx for sharing. If the datasource of your news list is a pagedatacollection, you need to set the lstNewsList.PagingControl.CurrentPagingItemIndex before the Init in the custom pager. But else it works out of the box.</description>
		<content:encoded><![CDATA[<p>Thanx for sharing. If the datasource of your news list is a pagedatacollection, you need to set the lstNewsList.PagingControl.CurrentPagingItemIndex before the Init in the custom pager. But else it works out of the box.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrey Lazarev</title>
		<link>http://www.frederikvig.com/2009/09/creating-a-custom-episerver-paging-control/comment-page-1/#comment-170</link>
		<dc:creator>Andrey Lazarev</dc:creator>
		<pubDate>Thu, 14 Jan 2010 14:27:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.frederikvig.com/?p=224#comment-170</guid>
		<description>Frederik, it looks like a dumb joke, but I got it working making this change:

if (EnablePaging == true)
            {
                this.epiNewsListSimple.Paging = true;
                this.epiNewsListSimple.PageLink = newssource;
                this.epiNewsListSimple.PagingControl = new CustomPager();
                this.epiNewsListSimple.PagesPerPagingItem = 3;

                if (Request.QueryString[&quot;p&quot;] != null)
                {
                    this.epiNewsListSimple.PagingControl.CurrentPagingItemIndex = int.Parse(Request.QueryString[&quot;p&quot;].ToString().Trim());
                }
            }
            else
            {
                this.epiNewsListSimple.Paging = false;
                this.epiNewsListSimple.PageLink = newssource;
                this.epiNewsListSimple.MaxCount = 3;
            }

            this.epiNewsListSimple.DataBind();

So, for me it looks like changes to the paging control made from the custom class didn&#039;t change anything in fact :(
Very strange...

Anyway - the control is working as expected now.</description>
		<content:encoded><![CDATA[<p>Frederik, it looks like a dumb joke, but I got it working making this change:</p>
<p>if (EnablePaging == true)<br />
            {<br />
                this.epiNewsListSimple.Paging = true;<br />
                this.epiNewsListSimple.PageLink = newssource;<br />
                this.epiNewsListSimple.PagingControl = new CustomPager();<br />
                this.epiNewsListSimple.PagesPerPagingItem = 3;</p>
<p>                if (Request.QueryString["p"] != null)<br />
                {<br />
                    this.epiNewsListSimple.PagingControl.CurrentPagingItemIndex = int.Parse(Request.QueryString["p"].ToString().Trim());<br />
                }<br />
            }<br />
            else<br />
            {<br />
                this.epiNewsListSimple.Paging = false;<br />
                this.epiNewsListSimple.PageLink = newssource;<br />
                this.epiNewsListSimple.MaxCount = 3;<br />
            }</p>
<p>            this.epiNewsListSimple.DataBind();</p>
<p>So, for me it looks like changes to the paging control made from the custom class didn&#8217;t change anything in fact <img src='http://www.frederikvig.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
Very strange&#8230;</p>
<p>Anyway &#8211; the control is working as expected now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frederik Vig</title>
		<link>http://www.frederikvig.com/2009/09/creating-a-custom-episerver-paging-control/comment-page-1/#comment-169</link>
		<dc:creator>Frederik Vig</dc:creator>
		<pubDate>Thu, 14 Jan 2010 13:31:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.frederikvig.com/?p=224#comment-169</guid>
		<description>If you remove all the code inside the CustomPager class, so you only have something like this left.
&lt;pre lang=&quot;csharp&quot;&gt;
public class CustomPager : PagingControl
{
}
&lt;/pre&gt;
The paging should work. After making sure it works try adding a few more methods and check that it still works, then some more etc, until you find the source of the problem.</description>
		<content:encoded><![CDATA[<p>If you remove all the code inside the CustomPager class, so you only have something like this left.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> CustomPager <span style="color: #008000;">:</span> PagingControl
<span style="color: #000000;">&#123;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>The paging should work. After making sure it works try adding a few more methods and check that it still works, then some more etc, until you find the source of the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrey Lazarev</title>
		<link>http://www.frederikvig.com/2009/09/creating-a-custom-episerver-paging-control/comment-page-1/#comment-168</link>
		<dc:creator>Andrey Lazarev</dc:creator>
		<pubDate>Thu, 14 Jan 2010 13:28:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.frederikvig.com/?p=224#comment-168</guid>
		<description>Re-tested once again - still same strange behavior. Standard paging is working for PageList and the custom one - isn&#039;t. :(</description>
		<content:encoded><![CDATA[<p>Re-tested once again &#8211; still same strange behavior. Standard paging is working for PageList and the custom one &#8211; isn&#8217;t. <img src='http://www.frederikvig.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrey Lazarev</title>
		<link>http://www.frederikvig.com/2009/09/creating-a-custom-episerver-paging-control/comment-page-1/#comment-167</link>
		<dc:creator>Andrey Lazarev</dc:creator>
		<pubDate>Thu, 14 Jan 2010 13:21:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.frederikvig.com/?p=224#comment-167</guid>
		<description>Frederik, you mean - using not custom but &#039;standard&#039; paging control? Yes, I tried this too - it is working.
The only difference from your code is that I didn&#039;t placed the EPiServer.PageList control inside the page template but in the WebControl instead:

pageTemplate[ WebControl[PageList] ]

And now I&#039;m trying to apply custom paging to this PageList.

Also I&#039;ve selected to use simple links instead of ...:

        protected override LinkButton AddSelectedPagingLink(int pagingIndex, string text, string altText)
        {
            HtmlGenericControl cntrl = new HtmlGenericControl();
            cntrl.Attributes.Add(&quot;class&quot;, this.CssClassSelected);
            cntrl.InnerText = text;
            HtmlGenericControl cntrlSeparator = new HtmlGenericControl();
            cntrlSeparator.InnerHtml = &quot;&#160;&#160;&#160;&#160;&quot;;
            this.HtmlContainer.Controls.Add(cntrl);
            this.HtmlContainer.Controls.Add(cntrlSeparator);
            return null;
        }

        protected override LinkButton AddUnselectedPagingLink(int pagingIndex, string text, string altText, bool visible)
        {
            HtmlGenericControl cntrl = new HtmlGenericControl();
            HyperLink hlChild = this.CreatePagingHyperLink(pagingIndex, text, altText);
            hlChild.CssClass = this.CssClassUnselected;
            hlChild.Visible = visible;
            HtmlGenericControl hlChildSeparator = new HtmlGenericControl();
            hlChildSeparator.InnerHtml = &quot;&#160;&#160;&#160;&#160;&quot;;
            
            cntrl.Controls.Add(hlChild);
            cntrl.Controls.Add(hlChildSeparator);
            this.HtmlContainer.Controls.Add(cntrl);
            return null;
        }

        // Code for this: http://world.episerver.com/Forum/Pages/Thread.aspx?id=19742&amp;epslanguage=en#RE:Custom%20pagin%20template
        private static string CreateUrl(int count)
        {
            UrlBuilder url = new UrlBuilder(HttpContext.Current.Request.Url.PathAndQuery);
            Global.UrlRewriteProvider.ConvertToExternal(url, null, UTF8Encoding.UTF8);

            return UriSupport.AddQueryString(url.ToString(), &quot;p&quot;, count.ToString());
        }

        protected HyperLink CreatePagingHyperLink(int pagingIndex, string text, string altText)
        {
            HyperLink link = new HyperLink();
            this.LinkCounter++;
            link.ID = &quot;PagingID&quot; + this.LinkCounter;
            link.NavigateUrl = CreateUrl(pagingIndex);
            link.Text = text;
            link.ToolTip = altText;

            return link;
        }

And - removed first-last, prev-next links

I have a public property in my webcontrol named &#039;EnablePaging&#039; and I&#039;m using it to select how PageList should be rendered:

            if (EnablePaging == true)
            {
                this.epiNewsListSimple.Paging = true;
                this.epiNewsListSimple.PageLink = newssource;
                this.epiNewsListSimple.PagingControl = new {%namespace here%}.CustomPager();
                this.epiNewsListSimple.PagesPerPagingItem = 3;
                this.epiNewsListSimple.MaxCount = -1;
                this.epiNewsListSimple.EnableViewState = true;
            }
            else
            {
                this.epiNewsListSimple.Paging = false;
                this.epiNewsListSimple.PageLink = newssource;
                this.epiNewsListSimple.MaxCount = 3;
            }

            this.epiNewsListSimple.DataBind();</description>
		<content:encoded><![CDATA[<p>Frederik, you mean &#8211; using not custom but &#8216;standard&#8217; paging control? Yes, I tried this too &#8211; it is working.<br />
The only difference from your code is that I didn&#8217;t placed the EPiServer.PageList control inside the page template but in the WebControl instead:</p>
<p>pageTemplate[ WebControl[PageList] ]</p>
<p>And now I&#8217;m trying to apply custom paging to this PageList.</p>
<p>Also I&#8217;ve selected to use simple links instead of &#8230;:</p>
<p>        protected override LinkButton AddSelectedPagingLink(int pagingIndex, string text, string altText)<br />
        {<br />
            HtmlGenericControl cntrl = new HtmlGenericControl();<br />
            cntrl.Attributes.Add(&#8220;class&#8221;, this.CssClassSelected);<br />
            cntrl.InnerText = text;<br />
            HtmlGenericControl cntrlSeparator = new HtmlGenericControl();<br />
            cntrlSeparator.InnerHtml = &#8220;&nbsp;&nbsp;&nbsp;&nbsp;&#8221;;<br />
            this.HtmlContainer.Controls.Add(cntrl);<br />
            this.HtmlContainer.Controls.Add(cntrlSeparator);<br />
            return null;<br />
        }</p>
<p>        protected override LinkButton AddUnselectedPagingLink(int pagingIndex, string text, string altText, bool visible)<br />
        {<br />
            HtmlGenericControl cntrl = new HtmlGenericControl();<br />
            HyperLink hlChild = this.CreatePagingHyperLink(pagingIndex, text, altText);<br />
            hlChild.CssClass = this.CssClassUnselected;<br />
            hlChild.Visible = visible;<br />
            HtmlGenericControl hlChildSeparator = new HtmlGenericControl();<br />
            hlChildSeparator.InnerHtml = &#8220;&nbsp;&nbsp;&nbsp;&nbsp;&#8221;;</p>
<p>            cntrl.Controls.Add(hlChild);<br />
            cntrl.Controls.Add(hlChildSeparator);<br />
            this.HtmlContainer.Controls.Add(cntrl);<br />
            return null;<br />
        }</p>
<p>        // Code for this: <a href="http://world.episerver.com/Forum/Pages/Thread.aspx?id=19742&amp;epslanguage=en#RE:Custom%20pagin%20template" rel="nofollow">http://world.episerver.com/Forum/Pages/Thread.aspx?id=19742&amp;epslanguage=en#RE:Custom%20pagin%20template</a><br />
        private static string CreateUrl(int count)<br />
        {<br />
            UrlBuilder url = new UrlBuilder(HttpContext.Current.Request.Url.PathAndQuery);<br />
            Global.UrlRewriteProvider.ConvertToExternal(url, null, UTF8Encoding.UTF8);</p>
<p>            return UriSupport.AddQueryString(url.ToString(), &#8220;p&#8221;, count.ToString());<br />
        }</p>
<p>        protected HyperLink CreatePagingHyperLink(int pagingIndex, string text, string altText)<br />
        {<br />
            HyperLink link = new HyperLink();<br />
            this.LinkCounter++;<br />
            link.ID = &#8220;PagingID&#8221; + this.LinkCounter;<br />
            link.NavigateUrl = CreateUrl(pagingIndex);<br />
            link.Text = text;<br />
            link.ToolTip = altText;</p>
<p>            return link;<br />
        }</p>
<p>And &#8211; removed first-last, prev-next links</p>
<p>I have a public property in my webcontrol named &#8216;EnablePaging&#8217; and I&#8217;m using it to select how PageList should be rendered:</p>
<p>            if (EnablePaging == true)<br />
            {<br />
                this.epiNewsListSimple.Paging = true;<br />
                this.epiNewsListSimple.PageLink = newssource;<br />
                this.epiNewsListSimple.PagingControl = new {%namespace here%}.CustomPager();<br />
                this.epiNewsListSimple.PagesPerPagingItem = 3;<br />
                this.epiNewsListSimple.MaxCount = -1;<br />
                this.epiNewsListSimple.EnableViewState = true;<br />
            }<br />
            else<br />
            {<br />
                this.epiNewsListSimple.Paging = false;<br />
                this.epiNewsListSimple.PageLink = newssource;<br />
                this.epiNewsListSimple.MaxCount = 3;<br />
            }</p>
<p>            this.epiNewsListSimple.DataBind();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frederik Vig</title>
		<link>http://www.frederikvig.com/2009/09/creating-a-custom-episerver-paging-control/comment-page-1/#comment-166</link>
		<dc:creator>Frederik Vig</dc:creator>
		<pubDate>Thu, 14 Jan 2010 11:47:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.frederikvig.com/?p=224#comment-166</guid>
		<description>@Peter - Sorry for not getting back to you until now.. I&#039;ve updated the code a little now to support both friendly and regular urls (just updated the CreateUrl method)
@Andrey - Sounds like a databinding problem.. have you tried using EPiServer paging control? I&#039;m guessing you&#039;ll get the same result with it. This is only guessing, I&#039;ll need to take a look at your code to give a proper answer.</description>
		<content:encoded><![CDATA[<p>@Peter &#8211; Sorry for not getting back to you until now.. I&#8217;ve updated the code a little now to support both friendly and regular urls (just updated the CreateUrl method)<br />
@Andrey &#8211; Sounds like a databinding problem.. have you tried using EPiServer paging control? I&#8217;m guessing you&#8217;ll get the same result with it. This is only guessing, I&#8217;ll need to take a look at your code to give a proper answer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrey Lazarev</title>
		<link>http://www.frederikvig.com/2009/09/creating-a-custom-episerver-paging-control/comment-page-1/#comment-165</link>
		<dc:creator>Andrey Lazarev</dc:creator>
		<pubDate>Thu, 14 Jan 2010 09:18:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.frederikvig.com/?p=224#comment-165</guid>
		<description>Hello, Frederik!

I&#039;ve used your approach to implement the custom paging and it works OK, but...
Paging works correctly *ONLY* for logged-in users. For anynomous visitor - when you click &quot;2&quot; in paging the same first page will be just reloaded.

Any ideas why this could be?</description>
		<content:encoded><![CDATA[<p>Hello, Frederik!</p>
<p>I&#8217;ve used your approach to implement the custom paging and it works OK, but&#8230;<br />
Paging works correctly *ONLY* for logged-in users. For anynomous visitor &#8211; when you click &#8220;2&#8243; in paging the same first page will be just reloaded.</p>
<p>Any ideas why this could be?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nulled Scripts</title>
		<link>http://www.frederikvig.com/2009/09/creating-a-custom-episerver-paging-control/comment-page-1/#comment-145</link>
		<dc:creator>Nulled Scripts</dc:creator>
		<pubDate>Tue, 22 Dec 2009 22:17:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.frederikvig.com/?p=224#comment-145</guid>
		<description>Nice post..Keep them coming :) Thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Nice post..Keep them coming <img src='http://www.frederikvig.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thanks for sharing.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->