WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

ASP Content Linking Component


ASP Content Linking Component

The ASP Content Linking part is utilized to make a snappy and simple route system!

The Content Linking part restores a Nextlink object that is utilized to hold a rundown of Web pages to be navigated.

Syntax

<%
Set nl=Server.CreateObject("MSWC.NextLink")
%>

ASP Content Linking Example

First we make a content record - "links.txt":

asp_intro.asp ASP Intro
asp_syntax.asp ASP Syntax
asp_variables.asp ASP Variables
asp_procedures.asp ASP Procedures

The content record above contains the pages to be explored. The pages must be recorded in a similar request you need them to be shown, and it should likewise contain a portrayal for each record name (utilize the tab key to isolate document name from description).

Note: If you need to include a page, or change the request of the pages in the rundown; you just need to adjust the content record! The route will consequently be corrected!

Then we make an incorporate record, "nlcode.inc". The .inc record makes a NextLink article to explore between the pages recorded in "links.txt".

"nlcode.inc":

<%
diminish nl
Set nl=Server.CreateObject("MSWC.NextLink")
in the event that (nl.GetListIndex("links.txt")>1) then
  Response.Write("<a href='" & nl.GetPreviousURL("links.txt"))
  Response.Write("'>Previous Page</a>")
end if
Response.Write("<a href='" & nl.GetNextURL("links.txt"))
Response.Write("'>Next Page</a>")
%>

In each of the .asp pages recorded in the content document "links.txt", put one line of code: <!- - #include file="nlcode.inc"- - >. This line will incorporate the code in "nlcode.inc" on each page recorded in "links.txt" and the route will work.


ASP Content Linking Component's Methods

Method Description Example
GetListCount Returns the quantity of things recorded in the Content Linking List file <%
diminish nl,c
Set nl=Server.CreateObject("MSWC.NextLink")
c=nl.GetListCount("links.txt")
Response.Write("There are ")
Response.Write(c)
Response.Write(" things in the list")
%>

Output:

There are 4 things in the list

GetListIndex Returns the record number of the present thing in the Content Linking Rundown document. The record number of the principal thing is 1. 0 is returned whether the current page isn't in the Content Linking List file <%
diminish nl,c
Set nl=Server.CreateObject("MSWC.NextLink")
c=nl.GetListIndex("links.txt")
Response.Write("Item number ")
Response.Write(c)
%>

Output:

Item number 3

GetNextDescription Returns the content portrayal of the following thing recorded in the Content Connecting List document. In the event that the present page isn't found in the rundown document it restores the content depiction of the keep going page on the list <%
diminish nl,c
Set nl=Server.CreateObject("MSWC.NextLink")
c=nl.GetNextDescription("links.txt")
Response.Write("Next ")
Response.Write("description is: ")
Response.Write(c)
%>

Next depiction is: ASP Variables

GetNextURL Returns the URL of the following thing recorded in the Content Linking List record. On the off chance that the present page isn't found in the rundown record it restores the URL of the keep going page on the list <%
diminish nl,c
Set nl=Server.CreateObject("MSWC.NextLink")
c=nl.GetNextURL("links.txt")
Response.Write("Next ")
Response.Write("URL is: ")
Response.Write(c)
%>

Next URL is: asp_variables.asp

GetNthDescription Returns the depiction of the Nth page recorded in the Content Linking Rundown file <%
diminish nl,c
Set nl=Server.CreateObject("MSWC.NextLink")
c=nl.GetNthDescription("links.txt",3)
Response.Write("Third ")
Response.Write("description is: ")
Response.Write(c)
%>

Third depiction is: ASP Variables

GetNthURL Returns the URL of the Nth page recorded in the Content Linking List file <%
diminish nl,c
Set nl=Server.CreateObject("MSWC.NextLink")
c=nl.GetNthURL("links.txt",3)
Response.Write("Third ")
Response.Write("URL is: ")
Response.Write(c)
%>

Third URL is: asp_variables.asp

GetPreviousDescription Returns the content depiction of the past thing recorded in the Content Connecting List record. On the off chance that the present page isn't found in the rundown document it restores the content depiction of the principal page on the list <%
diminish nl,c
Set nl=Server.CreateObject("MSWC.NextLink")
c=nl.GetPreviousDescription("links.txt")
Response.Write("Previous ")
Response.Write("description is: ")
Response.Write(c)
%>

Previous depiction is: ASP Variables

GetPreviousURL Returns the URL of the past thing recorded in the Content Linking List record. On the off chance that the present page isn't found in the rundown record it restores the URL of the principal page on the list <%
diminish nl,c
Set nl=Server.CreateObject("MSWC.NextLink")
c=nl.GetPreviousURL("links.txt")
Response.Write("Previous ")
Response.Write("URL is: ")
Response.Write(c)
%>

Previous URL is: asp_variables.asp