ASP 콘텐츠 링크하기
시도 - 예
콘텐츠 링킹 구성 요소
이 경우에 목차를 작성한다.
콘텐츠 링킹 구성 요소 (2)
이 예는 탐색 할 텍스트 파일의 페이지 사이에 구성 요소를 연결 콘텐츠를 사용합니다.
ASP 콘텐츠 링킹 구성 요소
ASP 빠르고 쉽게 네비게이션 시스템을 만들기위한 콘텐츠 연결기 성분!
콘텐츠 링킹 요소는 필요한 탐색 페이지의리스트를 보유하는 데 사용되는 넥스트 링크 오브젝트를 반환한다.
문법
Set nl=Server.CreateObject("MSWC.NextLink")
%>
ASP 콘텐츠 링크하기 예제
첫째, 우리는 텍스트 파일을 만듭니다 - "들은 links.txt을"
asp_syntax.asp ASP 语法
asp_variables.asp ASP 变量
asp_procedures.asp ASP 程序
필요한 탐색 페이지가 포함 된 위의 텍스트 파일. 페이지 순서는 동일한 순서로 표시하고, 각 파일명의 디스크립션을 (사용 탭 파일 이름과 설명을 분리하기 위해)를 포함한다.
참고 : 목록에 페이지를 추가하거나 목록에서 페이지 순서를 변경하려면, 다음 텍스트를 파일을 수정하기 만하면됩니다!내비게이션이 자동으로 업데이트됩니다!
우리는 그 다음 참조 파일, "nlcode.inc"을 만들 수 있습니다. 페이지 사이 .inc 파일 탐색에서 "들은 links.txt"에 나열된 넥스트 링크 개체를 만들 수 있습니다.
"Nlcode.inc"
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>")
%>
<- 사용법 #include 파일 = "nlcode.inc : 코드 줄에 나열된 각 .asp 페이지 텍스트 파일"들은 links.txt "에 배치하십시오 !"->.탐색에서 "들은 links.txt"에 나열된 모든 페이지에 코드 참조 "nlcode.inc"이 코드 줄은 작동합니다.
ASP 콘텐츠 링킹 요소에있어서
方法 | 描述 | 实例 |
---|---|---|
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 |