最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

ASP Content Linking 組件

實例

Content Linking 組件
本例會構(gòu)建一個內(nèi)容列表。
Content Linking 組件 2
本例使用 Content Linking 組件在一個文本文件所列的頁面間進行導航。

ASP Content Linking 組件

ASP Content Linking 組件用于創(chuàng)建快捷便利的導航系統(tǒng)。

Content Linking 組件會返回一個 Nextlink 對象,這個對象用于容納需要導航網(wǎng)頁的一個列表。

語法

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

首先,我們會創(chuàng)建文本文件 - "links.txt"。此文件包含需要導航的頁面的相關信息。頁面的排列順序應該與它們的顯示順序相同,并包含對每個文件的描述(使用制表符來分隔文件名和描述信息)。

注釋:如果你希望向列表添加文件信息,或者改變在列表中的頁面順序,那么你需要做的所有事情僅僅是修改這個文本文件而已!然后導航系統(tǒng)會自動地更新!

"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 方法

返回內(nèi)容鏈接列表文件中所列項目的數(shù)目:

<%
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 方法

返回在內(nèi)容鏈接列表文件中當前文件的索引號。第一個條目的索引號是 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 方法

返回在內(nèi)容鏈接列表文件中所列的下一個條目的文本描述。假如在列表文件中沒有找到當前文件,則列表中最后一個頁面的文本描述。

例子

<%
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 方法

返回在內(nèi)容鏈接列表文件中所列的下一個條目的 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èi)容鏈接列表文件中所列的第 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èi)容鏈接列表文件中所列的第 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 方法

返回在內(nèi)容鏈接列表文件中所列前一個條目的文本描述。假如在列表文件中沒有找到當前文件,則列表中第一個頁面的文本描述。

例子

<%
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 方法

返回在內(nèi)容鏈接列表文件中所列前一個條目的 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

蒙阴县| 逊克县| 霍林郭勒市| 信阳市| 巧家县| 神农架林区| 凭祥市| 柘城县| 突泉县| 平安县| 伊川县| 双辽市| 宜州市| 开原市| 陕西省| 瑞金市| 革吉县| 南江县| 安达市| 忻城县| 红桥区| 张家港市| 舞钢市| 龙胜| 文登市| 南充市| 旬邑县| 屏边| 漠河县| 汶川县| 泸水县| 乌兰县| 呼和浩特市| 安陆市| 化州市| 平昌县| 三亚市| 涪陵区| 陵川县| 格尔木市| 台南市|