How to specify class in pagination

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
brianhk00
Ensign (ENS)
Ensign (ENS)
Posts: 5
Joined: Sun Dec 12, 2010 12:17 pm

How to specify class in pagination

Post by brianhk00 » Tue Jan 10, 2012 12:42 am

In searchpage.ascx, I see the following code.

Code: Select all

<asp:Repeater ID="PagerControls" runat="server" OnItemCommand="PagerControls_ItemCommand">
<ItemTemplate>
<a class='<%#Eval("TagClass")%>'  href='<%#Eval("NavigateUrl")%>'><%#Eval("Text")%></a>
</ItemTemplate>
</asp:Repeater>
How can I specify the TagClass?

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: How to specify class in pagination

Post by jmestep » Tue Jan 10, 2012 9:37 am

One way it is defined is in the App_Code/NavigationHelper.cs. It adds a class of "current" to the current page number.

Code: Select all

while (pageIndexCounter <= lastPagerIndex)
        {
            string linkText = ((int)(pageIndexCounter + 1)).ToString();
            if (pageIndexCounter != currentPagerIndex)
            {
                navigateUrl = baseUrl + pageIndexCounter.ToString();
                pagerLinkData.Add(new PagerLinkData(linkText, navigateUrl, pageIndexCounter, (pageIndexCounter != currentPagerIndex)));
            }
            else
            {
                navigateUrl = "#";
                pagerLinkData.Add(new PagerLinkData(linkText, navigateUrl, pageIndexCounter, (pageIndexCounter != currentPagerIndex), "current"));
            }
            pageIndexCounter++;
        }
You can add a class here
pagerLinkData.Add(new PagerLinkData(linkText, navigateUrl, pageIndexCounter, (pageIndexCounter != currentPagerIndex,"yourclass")));
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Post Reply