ASP Content Linking ×é¼þ

ʵÀý

Content Linking ×é¼þ
±¾Àý»á¹¹½¨Ò»¸öÄÚÈÝÁÐ±í¡£
Content Linking ×é¼þ 2
±¾ÀýʹÓà Content Linking ×é¼þÔÚÒ»¸öÎı¾ÎļþËùÁеÄÒ³Ãæ¼ä½øÐе¼º½¡£

ASP Content Linking ×é¼þ

ASP Content Linking ×é¼þÓÃÓÚ´´½¨¿ì½Ý±ãÀûµÄµ¼º½ÏµÍ³¡£

Content Linking ×é¼þ»á·µ»ØÒ»¸ö Nextlink ¶ÔÏó£¬Õâ¸ö¶ÔÏóÓÃÓÚÈÝÄÉÐèÒªµ¼º½ÍøÒ³µÄÒ»¸öÁÐ±í¡£

Óï·¨

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

Ê×ÏÈ£¬ÎÒÃǻᴴ½¨Îı¾Îļþ - "links.txt"¡£´ËÎļþ°üº¬ÐèÒªµ¼º½µÄÒ³ÃæµÄÏà¹ØÐÅÏ¢¡£Ò³ÃæµÄÅÅÁÐ˳ÐòÓ¦¸ÃÓëËüÃǵÄÏÔʾ˳ÐòÏàͬ£¬²¢°üº¬¶Ôÿ¸öÎļþµÄÃèÊö£¨Ê¹ÓÃÖÆ±í·ûÀ´·Ö¸ôÎļþÃûºÍÃèÊöÐÅÏ¢£©¡£

×¢ÊÍ£ºÈç¹ûÄãÏ£ÍûÏòÁбíÌí¼ÓÎļþÐÅÏ¢£¬»òÕ߸ıäÔÚÁбíÖеÄÒ³ÃæË³Ðò£¬ÄÇôÄãÐèÒª×öµÄËùÓÐÊÂÇé½ö½öÊÇÐÞ¸ÄÕâ¸öÎı¾Îļþ¶øÒÑ£¡È»ºóµ¼º½ÏµÍ³»á×Ô¶¯µØ¸üУ¡

"links.txt":

asp_intro.asp ASP ¼ò½é
asp_syntax.asp ASP Óï·¨
asp_variables.asp ASP ±äÁ¿
asp_procedures.asp ASP ³ÌÐò 

ÇëÔÚÉÏÃæÁгöµÄÒ³ÃæÖзÅÖÃÕâÐдúÂ룺<!-- #include file="nlcode.inc"-->¡£ÕâÐдúÂë»áÔÚ "links.txt" ÖÐÁгöÿ¸öÒ³ÃæÉÏÒýÓÃÏÂÃæÕâ¶Î´úÂ룬ÕâÑùµ¼º½¾Í¿ÉÒÔ¹¤×÷ÁË¡£

"nlcode.inc":

<%
'Use the Content Linking Component 
'to navigate between the pages listed
'in links.txt

dim nl
Set nl=Server.CreateObject("MSWC.NextLink")
if (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>")
%>

ASP Content Linking ×é¼þµÄ·½·¨

GetListCount ·½·¨

·µ»ØÄÚÈÝÁ´½ÓÁбíÎļþÖÐËùÁÐÏîÄ¿µÄÊýÄ¿£º

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetListCount("links.txt") 
Response.Write("There are ")
Response.Write(c)
Response.Write(" items in the list")
%>

Êä³ö£º

There are 4 items in the list

GetListIndex ·½·¨

·µ»ØÔÚÄÚÈÝÁ´½ÓÁбíÎļþÖе±Ç°ÎļþµÄË÷ÒýºÅ¡£µÚÒ»¸öÌõÄ¿µÄË÷ÒýºÅÊÇ 1¡£¼ÙÈçµ±Ç°Ò³Ãæ²»ÔÚÁбíÎļþÖУ¬Ôò·µ»Ø 0¡£

Àý×Ó

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetListIndex("links.txt") 
Response.Write("Item number ")
Response.Write(c)
%>

Êä³ö£º

Item number 3

GetNextDescription ·½·¨

·µ»ØÔÚÄÚÈÝÁ´½ÓÁбíÎļþÖÐËùÁеÄÏÂÒ»¸öÌõÄ¿µÄÎı¾ÃèÊö¡£¼ÙÈçÔÚÁбíÎļþÖÐûÓÐÕÒµ½µ±Ç°Îļþ£¬ÔòÁбíÖÐ×îºóÒ»¸öÒ³ÃæµÄÎı¾ÃèÊö¡£

Àý×Ó

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetNextDescription("links.txt") 
Response.Write("Next ")
Response.Write("description is: ")
Response.Write(c)
%>

Êä³ö£ºNext description is: ASP Variables

GetNextURL ·½·¨

·µ»ØÔÚÄÚÈÝÁ´½ÓÁбíÎļþÖÐËùÁеÄÏÂÒ»¸öÌõÄ¿µÄ URL¡£¼ÙÈçÔÚÁбíÎļþÖÐûÓÐÕÒµ½µ±Ç°Îļþ£¬ÔòÁбíÖÐ×îºóÒ»¸öÒ³ÃæµÄ URL¡£

Àý×Ó

<%
dim 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 ·½·¨

·µÔÚÄÚÈÝÁ´½ÓÁбíÎļþÖÐËùÁÐµÄµÚ N ¸öÒ³ÃæµÄÃèÊöÐÅÏ¢¡£

Àý×Ó

<%
dim 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 description is: ASP Variables

GetNthURL ·½·¨

·µÔÚÄÚÈÝÁ´½ÓÁбíÎļþÖÐËùÁÐµÄµÚ N ¸öÒ³ÃæµÄ URL¡£

Àý×Ó

<%
dim 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 ·½·¨

·µ»ØÔÚÄÚÈÝÁ´½ÓÁбíÎļþÖÐËùÁÐǰһ¸öÌõÄ¿µÄÎı¾ÃèÊö¡£¼ÙÈçÔÚÁбíÎļþÖÐûÓÐÕÒµ½µ±Ç°Îļþ£¬ÔòÁбíÖеÚÒ»¸öÒ³ÃæµÄÎı¾ÃèÊö¡£

Àý×Ó

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetPreviousDescription("links.txt") 
Response.Write("Previous ")
Response.Write("description is: ")
Response.Write(c)
%>

Êä³ö£ºPrevious description is: ASP Variables

GetPreviousURL ·½·¨

·µ»ØÔÚÄÚÈÝÁ´½ÓÁбíÎļþÖÐËùÁÐǰһ¸öÌõÄ¿µÄ URL¡£¼ÙÈçÔÚÁбíÎļþÖÐûÓÐÕÒµ½µ±Ç°Îļþ£¬ÔòÁбíÖеÚÒ»¸öÒ³ÃæµÄURL¡£

Àý×Ó

<%
dim 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

VUE