Counter Linking Component - Automatically Link Content Pages in ASP

Last Updated: Nov 15, 2025
8 min read
Legacy Archive
Legacy Guidance: This article preserves historical web development content. For modern .NET 8+ best practices, visit our Tutorials section.

When you want to link together pages with previous and next page functionality, you had to insert links manually for this to work. Whenever a page was added or inserted, you had to adjust links in two more files. This is tedious work and can introduce errors in the order the pages are linked together, as well as with the table of contents you still must write on your own.

For sequential page linking, you'd need to maintain 2*(x-1) links, where X is the number of pages. That's a lot of manual maintenance for what should be a simple navigation system!

Sequential Page Linking Challenge

Traditional sequential page linking looks like this: File 1 → File 2 → File 3 → ... → File X. Managing this manually becomes increasingly difficult as your content grows. Each time you insert a new page in the middle, you've got to update the previous and next links in multiple files.

The Counter Linking Component makes life much easier. It has a supporting text file in which all page links are stored together with a descriptive text in the order the pages are linked together. You simply insert the URL and description once, and you can create the table of contents and the links between the pages automatically.

The Content Linking List File

If you change a line in the supporting text file, the changes are immediately reflected in the table of contents and link order. There's no need to update files manually. The format for the supporting text file, called the content linking list file, is very easy.

First comes the URL, followed by a tab character separating the URL from the description. The tab character is crucial—it's what separates the two fields.

content-links.txt
stepa.asp	Step A - Introduction
stepb.asp	Step B - Configuration
stepc.asp	Step C - Implementation
stepd.asp	Step D - Testing (Last One)

Important: The tab character in the listing above isn't a new HTML tag—it's an actual tab character. You wouldn't see it in print, but in your text editor, you'll press the Tab key to separate the URL from its description.

You can reference any file on your local server, but URLs using the http:// syntax to access files not located on your local server are not supported and will not be processed.

Using the Counter Linking Component

The first task is to create a table of contents for the linked content. Before you start using any component, you should always take a look at the documentation to ensure you're taking the most direct route to achieve your goal.

The Counter Linking Component reads your content linking list file and provides methods to generate navigation links and table of contents automatically. This saves you from the error-prone process of manually managing dozens or hundreds of links.

CreateTableOfContents.asp
<%
' Create the Content Linking object
Set objNextLink = Server.CreateObject("MSWC.NextLink")

' Generate a table of contents from the content linking list
Response.Write "<h2>Table of Contents</h2>"
Response.Write "<ul>"

' Loop through all links in the content linking list
For i = 1 To objNextLink.GetListCount("content-links.txt")
    strURL = objNextLink.GetNthURL("content-links.txt", i)
    strDesc = objNextLink.GetNthDescription("content-links.txt", i)
    Response.Write "<li><a href='" & strURL & "'>" & strDesc & "</a></li>"
Next

Response.Write "</ul>"

' Clean up
Set objNextLink = Nothing
%>

Benefits of Using Counter Linking Component

The Counter Linking Component offers several key advantages for managing sequential content. It eliminates manual link maintenance, reducing the chance of broken or incorrect links. Adding or removing pages is as simple as editing one text file.

You can automatically generate table of contents pages without writing repetitive HTML. The component ensures consistent navigation throughout your content series. It's perfect for tutorials, documentation, multi-part articles, and any content that needs sequential navigation.

Best Practices

Keep your content linking list file organized and well-documented. Use descriptive names for your descriptions to make navigation clear to users. Test your navigation thoroughly after making changes to the list file. Always use tab characters, not spaces, to separate URLs from descriptions.

Consider keeping a backup of your content linking list file, as it's critical to your site navigation. Document the order of your pages if the sequence is important. The Counter Linking Component is a powerful tool that can save you hours of manual work while improving the reliability of your sequential navigation.

FAQ

What problem does the Counter Linking Component solve?

It eliminates the tedious task of manually inserting and maintaining previous/next page links. Without it, you'd need to maintain 2*(x-1) links for x pages, updating two files every time you add or insert a page.

What is a content linking list file?

It's a simple text file where each line contains a URL followed by a tab character and a description. You store all your page links in order once, and the component automatically creates navigation and table of contents.

Can I use external URLs in the content linking list?

No, you can only reference files on your local server. URLs using http:// syntax to access files not located on your local server are not supported and will not be processed.

What happens when I add or remove a page from the list?

Changes to the content linking list file are immediately reflected in the table of contents and link order. There's no need to manually update individual files, making maintenance much easier.

Back to Articles