AJax技术

ASP内容链接组件

字号+ 作者:H5之家 来源:H5之家 2017-02-02 11:01 我要评论( )

良好的组织和易于理解,有很多如何使用HTML,CSS,JavaScript中,SQL,PHP和XML实例网站建设教程。

ASP内容链接组件

❮ 上一页下一章 ❯

例子

内容链接组件
建立一个目录。

内容链接组件2
使用Content Linking组件在一个文本文件中的页面之间进行导航。

ASP Content Linking组件

ASP的内容链接组件用于创建快捷便利的导航系统!

内容链接组件返回到进行导航,用于容纳网页的列表的NEXTLINK对象。

句法

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

ASP内容链接示例

首先,我们创建一个文本文件 - “links.txt”:

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

上面的文本文件包含页面导航。The pages must be listed in the same order you want them to be displayed, and it must also contain a description for each file name (use the tab key to separate file name from description). 该网页必须在要显示它们以相同的顺序被列出,并且它也必须包含每个文件名的描述(使用从描述以单独的文件名的标签键)。

注意:如果你想添加一个页面,或更改列表中的页面顺序;you only have to modify the text file! 你只需要修改文本文件!该导航系统会自动纠正!

然后,我们创建一个包含文件,“nlcode.inc”。The .inc file creates a NextLink object to navigate between the pages listed in "links.txt". 的。公司文件创建一个NEXTLINK对象“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>")
%>

在每一个文本文件“links.txt”中列出的.asp页,放一行代码:<! - #包括文件=“nlcode.inc” - >。This line will include the code in "nlcode.inc" on every page listed in "links.txt" and the navigation will work. 这条线将包括“nlcode.inc的”代码“links.txt”中列出的每一页上和导航就可以工作。

ASP Content Linking组件的方法

Method Description Example

GetListCount Returns the number of items listed in the Content Linking List file <%
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")
%>

Output:

There are 4 items in the list

GetListIndex Returns the index number of the current item in the Content Linking List file. The index number of the first item is 1. 0 is returned if the current page is not in the Content Linking List file <%
dim 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 text description of the next item listed in the Content Linking List file. If the current page is not found in the list file it returns the text description of the last page on the list <%
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 Returns the URL of the next item listed in the Content Linking List file. If the current page is not found in the list file it returns the URL of the last page on the list <%
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 Returns the description of the Nth page listed in the Content Linking List file <%
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 Returns the URL of the Nth page listed in the Content Linking List file <%
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 Returns the text description of the previous item listed in the Content Linking List file. If the current page is not found in the list file it returns the text description of the first page on the list <%
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

 

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • jQuery - 获取和设置CSS类

    jQuery - 获取和设置CSS类

    2017-02-02 11:00

  • Div+CSS布局入门教程

    Div+CSS布局入门教程

    2017-02-01 14:02

  • 如何使用Ajax技术开发Web应用程序(2)

    如何使用Ajax技术开发Web应用程序(2)

    2017-01-30 12:02

  • 利用CSS、JavaScript及Ajax实现图片预加载的三大方法

    利用CSS、JavaScript及Ajax实现图片预加载的三大方法

    2017-01-28 10:00

网友点评
p