Ajax functionality for UniPager connected with Repeater

   —   
This article describes, how you can achieve ajax functionality for UniPager connected with Repeater.
Firstly you may need to create and register new webpart. Now you can use following code:

<cms:CMSUpdatePanel runat="server" ID="updatePanel1">
<ContentTemplate>
    <cms:CMSRepeater ID="rptBlogs" DelayedLoading="true" Path="/%" ClassNames="cms.blogpost" TransformationName="cms.blogpost.default" runat="server" />
   
    <cms:UniPager ID="up1" PagerMode="PostBack" PageControl="rptBlogs" PageSize="1" runat="server">
        <pagenumberstemplate>
            <a href="<%# Eval("PageUrl") %>"> <%# Eval("page") %> </a>
        </pagenumberstemplate>
    </cms:UniPager>
   
</ContentTemplate>
</cms:CMSUpdatePanel>


It shows BlogPosts reduced by UniPager. They are enwrapped by UpdatePanel and finally it works via PostBack. Please note that you will need to change code above to suit your needs.

See also:

Applies to: Kentico CMS 4.0.
Share this article on   LinkedIn