Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

Examples: ASP Content Linking Component

The following example builds a table of contents.

<OL>

<%

Set NextLink = Server.CreateObject ("MSWC.NextLink")  

count = NextLink.GetListCount ("/data/nextlink.txt")  

I = 1  

%>

<UL>

<% Do While (I <= count) %>

<LI><A HREF=" <%= NextLink.GetNthURL ("/data/nextlink.txt", I) %> ">

<%= NextLink.GetNthDescription ("/data/nextlink.txt", I) %> </A>

<%

I = (I + 1)  

Loop 

%>

</UL>

</OL>

The following script adds the next-page and previous-page buttons to an HTML file.

<%

Set NextLink = Server.CreateObject ("MSWC.NextLink")  

If (NextLink.GetListIndex ("/data/nextlink.txt") > 1)  

Then  

%>

<A HREF=" <%= NextLink.GetPreviousURL ("/data/nextlink.txt") %> ">

Previous Page</A>

<% End If %>

<A HREF=" <%= NextLink.GetNextURL ("/data/nextlink.txt") %> ">Next Page</A>

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.