Chapter 59: ASP Content Linking Component
ASP Content Linking Component
This is the exact lesson that appears in the W3Schools Classic ASP tutorial under ASP Components, and it was one of the cutest little helpers that Microsoft included with IIS back in 1997–2002.
I will explain it like your favorite teacher who actually used Content Linking on small portal sites in the early 2000s (when it felt like magic) — slowly, clearly, with real working examples, good habits, common mistakes, why almost nobody uses it anymore, and why some very old legacy Indian community/classifieds/portal sites still have it lying around in 2026.
1. What is the Content Linking Component?
The Content Linking Component (often called Content Linking or NextLink) is a built-in ActiveX Server Component that helps you create simple sequential navigation between a list of web pages.
Think of it as a poor man’s “next/previous” article system or tutorial navigation — before blogs, CMS, or modern frameworks existed.
You give it a plain text file that lists URLs in order (like a playlist), and it automatically generates:
- “Next page” link
- “Previous page” link
- “Jump to page X” dropdown
- “You are on page 3 of 10” text
- Random jump (optional)
It was extremely popular in 1998–2005 for:
- Multi-page articles/tutorials (“Page 1 | 2 | 3 | Next »”)
- Photo galleries
- Step-by-step guides
- Old-school “top 10” lists split across pages
- Simple content sequencing without a database
2. The Two Main Files You Need
- The Content Linking List file (usually called contents.txt or nextlink.txt) A plain text file with one URL per line (relative or absolute).
Example contents.txt:
|
0 1 2 3 4 5 6 7 8 9 10 |
/tutorials/page1.asp /tutorials/page2.asp /tutorials/page3.asp /tutorials/page4.asp /tutorials/page5.asp |
- The .asp page that uses the Content Linking component to show navigation links.
3. Basic Example – Simple Multi-Page Article Navigation
File: contents.txt (in root or /tutorials/)
|
0 1 2 3 4 5 6 7 8 9 10 |
/tutorials/page1.asp /tutorials/page2.asp /tutorials/page3.asp /tutorials/page4.asp /tutorials/page5.asp |
File: page3.asp (one of the content pages)
|
0 1 2 3 4 5 6 |
<%@ Language=VBScript %> <% Option Explicit %> <!DOCTYPE html> <html> <head> <title>Page 3 - Classic ASP Tutorial</title> </head> <body> <h1>Page 3: Understanding VBScript Loops</h1> <p>This is the actual content of page 3...</p> <p>(Imagine long article text here...)</p> <!-- ====================== --> <!-- Content Linking Magic --> <!-- ====================== --> <% Dim objNextLink Set objNextLink = Server.CreateObject("MSWC.NextLink") ' Point to the list file Dim listFile listFile = Server.MapPath("contents.txt") ' Get current page index (1-based) Dim currentIndex currentIndex = objNextLink.GetListIndex(listFile, Request.ServerVariables("SCRIPT_NAME")) Response.Write "<p style='text-align:center; font-weight:bold;'>" Response.Write "Page " & currentIndex & " of " & objNextLink.GetListCount(listFile) Response.Write "</p>" Response.Write "<p style='text-align:center;'>" ' Previous link If currentIndex > 1 Then Dim prevURL prevURL = objNextLink.GetPreviousURL(listFile) Response.Write "<a href='" & prevURL & "'>« Previous Page</a> | " End If ' Next link If currentIndex < objNextLink.GetListCount(listFile) Then Dim nextURL nextURL = objNextLink.GetNextURL(listFile) Response.Write "<a href='" & nextURL & "'>Next Page »</a>" End If Response.Write "</p>" ' Optional: Dropdown to jump to any page Response.Write "<p style='text-align:center;'>Go to page: " Response.Write "<select onchange='location.href=this.value'>" Dim i For i = 1 To objNextLink.GetListCount(listFile) Dim pageURL, selected pageURL = objNextLink.GetNthURL(listFile, i) selected = IIf(i = currentIndex, " selected", "") Response.Write "<option value='" & pageURL & "'" & selected & ">" & i & "</option>" Next Response.Write "</select></p>" Set objNextLink = Nothing %> </body> </html> |
What happens:
- AdRotator-like component reads contents.txt
- Knows current page by matching SCRIPT_NAME against the list
- Automatically shows:
- “Page 3 of 5”
- « Previous Page | Next Page »
- Dropdown to jump to any page
4. Other Useful Methods of NextLink Object
| Method | What it returns | Typical use |
|---|---|---|
| GetListCount(listfile) | Total number of pages in the list | “Page X of Y” |
| GetListIndex(listfile, url) | Current page number (1-based) | Know where we are |
| GetNthURL(listfile, n) | URL of the nth page | Build dropdown |
| GetPreviousURL(listfile) | URL of previous page | « Previous |
| GetNextURL(listfile) | URL of next page | Next » |
| GetNthDescription(listfile, n) | Description (if you add it to contents.txt) | Rarely used |
Extended contents.txt (with description):
|
0 1 2 3 4 5 6 7 8 9 10 |
/tutorials/page1.asp Introduction /tutorials/page2.asp Variables /tutorials/page3.asp Loops /tutorials/page4.asp Conditions /tutorials/page5.asp Conclusion |
Then: objNextLink.GetNthDescription(listfile, 3) → “Loops”
5. Security & Best Practice Warnings (2026 Perspective)
- Never let users control the list file path — hard-code Server.MapPath(“contents.txt”)
- Protect contents.txt — move outside web root or block direct access in IIS (many sites were hacked by downloading the list and finding hidden pages)
- No dynamic list — contents.txt is static — if you need dynamic pages, use database + loop (much more common in real sites)
- Performance — very fast, list file is tiny and cached
- Obsolete today — modern sites use database + pagination or CMS — but still alive in very old Indian classifieds portals, tutorial sites, and internal documentation systems
6. Teacher Summary – ASP Content Linking Component in Classic ASP
ASP Content Linking Component (MSWC.NextLink) is:
- A built-in COM object that reads a simple text file listing page URLs in order
- Automatically generates “Previous | Next” links, page X of Y, jump-to dropdown
- Created with Server.CreateObject(“MSWC.NextLink”)
- Main method: GetAdvertisement(path) — but usually you use GetNextURL, GetPreviousURL, GetListCount, GetListIndex, GetNthURL
- List file format: one URL per line (optional description after tab)
- Optional REDIRECT line at top for click tracking (rarely used)
- Very popular 1998–2005 for multi-page articles, galleries, tutorials
- Almost never used today — replaced by database + pagination
- Still exists in many very old Indian community/tutorial/classifieds sites for static content sequencing
This is how millions of early websites created simple “next/previous” navigation without databases — and a few legacy Indian portals still use exactly this Content Linking pattern in 2026.
Next class?
- Want a full multi-page tutorial example with Content Linking + shared header/footer?
- Or how to add descriptions and make a nice jump menu?
- Or compare Classic ASP Content Linking vs modern pagination / React Router?
- Or move to the next W3Schools topic (ASP Content Rotator)?
Just tell me — I’m here! 🚀🇮🇳 Keep learning strong, Webliance! 😊
