+1-888-365-2779
Try Now
More in this section

Forums / Designing with Sitefinity / Pagingation on Control Template

Pagingation on Control Template

2 posts, 0 answered
  1. Kiearn
    Kiearn avatar
    6 posts
    Registered:
    07 Aug 2008
    14 May 2009
    Link to this post
    Hi

    I'm trying to create a custom news list control template in sitefinity 3.6. I have the list appearing fine but can't get the pagination to work.

    this is the code I have so far.


    <%@ Register Assembly="Telerik.Cms.Web.UI" Namespace="Telerik.Cms.Web.UI" TagPrefix="sfWeb" %> 
     
    <asp:Repeater ID="repeater" runat="server">  
        <HeaderTemplate> 
            <ul class="sf_newsList_subpage">  
        </HeaderTemplate> 
        <ItemTemplate> 
            <li> 
                <strong class="date"><%#DataBinder.Eval(Container.DataItem, "Publication_Date", "{0:dd MMMM yyyy}")%></strong><br /> 
                <strong><asp:Literal ID="Title" Text='<%# Eval("Title")%>' runat="server" /></strong><br /> 
                <asp:Literal ID="Source" Text='<%= Eval("Source">)%>' runat="server" /><br /> 
                <asp:HyperLink ID="fullContent2" runat="server">Read more...</asp:HyperLink> 
                 
             </li> 
        </ItemTemplate> 
        <FooterTemplate> 
            </ul> 
              
            </ol> 
            <p> 
                <asp:LinkButton ID="previousPage" runat="server" Text="Previous"></asp:LinkButton> 
                <asp:PlaceHolder ID="pageNumbers" runat="server"></asp:PlaceHolder> 
                <asp:LinkButton ID="nextPage" runat="server" Text="Next"></asp:LinkButton> 
            </p> 
        </FooterTemplate> 
          
    </asp:Repeater> 

    Thanks
    Kieran
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    15 May 2009
    Link to this post
    Hello Kiearn,

    You need to declare the Pager control in your template.

    <telerik:Pager ID="pager1" runat="server"
        <LayoutTemplate> 
            <asp:Repeater ID="PageRepeaterLinkButton" runat="server"
                <HeaderTemplate> 
                    <ol class="sf_pager"
                    <li><asp:LinkButton ID="PreviousPage" runat="server" Text="Previous"></asp:LinkButton></li
                </HeaderTemplate> 
                <ItemTemplate> 
                    <li> 
                        <asp:LinkButton ID="SingleItem" runat="server" /> 
                    </li> 
                </ItemTemplate> 
                <FooterTemplate> 
                    <li><asp:LinkButton ID="NextPage" runat="server" Text="Next"></asp:LinkButton></li
                    </ol> 
                </FooterTemplate> 
            </asp:Repeater> 
            <asp:Repeater ID="PageRepeaterHyperLink" runat="server"
                <HeaderTemplate> 
                    <ol class="sf_pager"
                    <li><asp:HyperLink ID="PreviousPage" runat="server" Text="Previous"></asp:HyperLink></li
                </HeaderTemplate> 
                <ItemTemplate> 
                    <li> 
                        <asp:HyperLink ID="SingleItem" runat="server" /> 
                    </li> 
                </ItemTemplate> 
                <FooterTemplate> 
                    <li><asp:HyperLink ID="NextPage" runat="server" Text="Next"></asp:HyperLink></li
                    </ol> 
                </FooterTemplate> 
            </asp:Repeater> 
        </LayoutTemplate> 
    </telerik:Pager> 

    Note that the ID of the control should be pager1 or pager2.

    Let us know if this helps.

    Sincerely yours,
    Pepi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered