⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asp_contentlinking.asp@output=print

📁 W3Schools tutorial..web designing
💻 ASP@OUTPUT=PRINT
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>ASP Content Linking</title>
 
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content="xml,tutorial,html,dhtml,css,xsl,xhtml,javascript,asp,ado,vbscript,dom,sql,colors,soap,php,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,w3c,cascading style sheets,active server pages,dynamic html,internet,database,development,Web building,Webmaster,html guide" />

<meta name="Description" content="Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building." />

<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "../../https@ssl./default.htm" : "../../www./default.htm");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3855518-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>

</head>
<body>

<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>

<h1>ASP Content Linking Component</h1>

<a href="asp_browser.asp"><img alt="previous" border="0" src="../images/btn_previous.gif" /></a>
<a href="asp_contentrotator.asp"><img alt="next" border="0" src="../images/btn_next.gif" /></a>

<hr />
<h2>Examples</h2>
<p><a target="_blank" href="showasp.asp@filename=demo_contentlinking">The Content Linking Component</a><br />
This example builds a table of contents.</p>
<p><a target="_blank" href="showasp.asp@filename=demo_contentlinking2">The Content Linking
Component 2</a><br />
The example uses the Content Linking Component to navigate between the pages in
a text file.</p>
<hr />
<h2>ASP Content Linking Component</h2>
<p>The ASP Content Linking component is used to create a quick and easy 
navigation system!</p>
<p>The Content Linking component returns a Nextlink object that is used to hold 
a list of Web pages to be navigated.</p>
<h3>Syntax</h3>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3">
  <tr valign="top">
    <td>&lt;%<br />
      Set nl=Server.CreateObject( "MSWC.NextLink" )<br />
      %&gt;</td>
  </tr>
</table>
<p>First we create a text file - &quot;links.txt&quot;. This file contains the pages to be 
navigated. The pages must be listed in the same order you want them to be 
displayed, and it also must contain a description for each file name (use the 
tab key to separate file name from description). <b>Note:</b> If you want to add 
a page to the list or change the order of the pages in the list; all you have to 
do is to modify the text file! The navigation will automatically be correct!</p>
<p>&quot;links.txt&quot;:</p>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3">
  <tr valign="top">
    <td>asp_intro.asp ASP Intro<br />
    asp_syntax.asp ASP Syntax<br />
    asp_variables.asp ASP Variables<br />
    asp_procedures.asp ASP Procedures</td>
  </tr>
</table>
<p>On each of the pages listed above, put one line of code: &lt;!-- #include file=&quot;nlcode.inc&quot;--&gt;. 
This line will include the code below on every page listed in &quot;links.txt&quot; and 
the navigation will work.</p>
<p>&quot;nlcode.inc&quot;:</p>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3">
  <tr valign="top">
    <td>
    <pre>&lt;%
'Use the Content Linking Component 
'to navigate between the pages listed
'in links.txt</pre>
    <pre>dim nl
Set nl=Server.CreateObject(&quot;MSWC.NextLink&quot;)
if (nl.GetListIndex(&quot;links.txt&quot;)&gt;1) then
  Response.Write(&quot;&lt;a href='&quot; &amp; nl.GetPreviousURL(&quot;links.txt&quot;))
  Response.Write(&quot;'&gt;Previous Page&lt;/a&gt;&quot;)
end if
Response.Write(&quot;&lt;a href='&quot; &amp; nl.GetNextURL(&quot;links.txt&quot;))
Response.Write(&quot;'&gt;Next Page&lt;/a&gt;&quot;)
%&gt;</pre>
    </td>
  </tr>
</table>
  <p>The ASP Content Linking Component's methods are described below: </p>
<h3>Methods</h3>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3">
  <tr valign="top">
    <th align="left">Method</th>
    <th align="left">Description</th>
    <th width="45%" align="left">Example</th>
  </tr>
  <tr valign="top">
    <td>GetListCount</td>
    <td> Returns the number of items listed in the Content Linking List file</td>
    <td> &lt;%<br />
    dim nl,c<br />
    Set nl=Server.CreateObject(&quot;MSWC.NextLink&quot;) <br />
    c=nl.GetListCount(&quot;links.txt&quot;) <br />
    Response.Write(&quot;There are &quot;)<br />
    Response.Write(c)<br />
    Response.Write(&quot; items in the list&quot;)<br />
    %&gt;<p>Output:</p>
    <p>There are 4 items in the list</p></td>
  </tr>
  <tr valign="top">
    <td>GetListIndex</td>
    <td> 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</td>
    <td> &lt;%<br />
    dim nl,c<br />
    Set nl=Server.CreateObject(&quot;MSWC.NextLink&quot;) <br />
    c=nl.GetListIndex(&quot;links.txt&quot;) <br />
    Response.Write(&quot;Item number &quot;)<br />
    Response.Write(c)<br />
    %&gt;<p>Output:</p>
    <p>Item number 3</p></td>
  </tr>
  <tr valign="top">
    <td>GetNextDescription</td>
    <td> 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</td>
    <td> &lt;%<br />
    dim nl,c<br />
    Set nl=Server.CreateObject(&quot;MSWC.NextLink&quot;) <br />
    c=nl.GetNextDescription(&quot;links.txt&quot;) <br />
    Response.Write(&quot;Next &quot;)<br />
    Response.Write(&quot;description is: &quot;)<br />
    Response.Write(c)<br />
    %&gt;<p>Next description is: ASP Variables</p></td>
  </tr>
  <tr valign="top">
    <td>GetNextURL</td>
    <td>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</td>
    <td>&lt;%<br />
    dim nl,c<br />
    Set nl=Server.CreateObject(&quot;MSWC.NextLink&quot;) <br />
    c=nl.GetNextURL(&quot;links.txt&quot;) <br />
    Response.Write(&quot;Next &quot;)<br />
    Response.Write(&quot;URL is: &quot;)<br />
    Response.Write(c)<br />
    %&gt;<p>Next URL is: asp_variables.asp</p></td>
  </tr>
  <tr valign="top">
    <td>GetNthDescription</td>
    <td> Returns the description of the Nth page listed in the Content Linking 
    List file</td>
    <td> &lt;%<br />
    dim nl,c<br />
    Set nl=Server.CreateObject(&quot;MSWC.NextLink&quot;) <br />
    c=nl.GetNthDescription(&quot;links.txt&quot;,3) <br />
    Response.Write(&quot;Third &quot;)<br />
    Response.Write(&quot;description is: &quot;)<br />
    Response.Write(c)<br />
    %&gt;<p>Third description is: ASP Variables</p></td>
  </tr>
  <tr valign="top">
    <td>GetNthURL</td>
    <td>Returns the URL of the Nth page listed in the Content Linking List file</td>
    <td>&lt;%<br />
    dim nl,c<br />
    Set nl=Server.CreateObject(&quot;MSWC.NextLink&quot;) <br />
    c=nl.GetNthURL(&quot;links.txt&quot;,3) <br />
    Response.Write(&quot;Third &quot;)<br />
    Response.Write(&quot;URL is: &quot;)<br />
    Response.Write(c)<br />
    %&gt;<p>Third URL is: asp_variables.asp</p></td>
  </tr>
  <tr valign="top">
    <td>GetPreviousDescription</td>
    <td> 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</td>
    <td> &lt;%<br />
    dim nl,c<br />
    Set nl=Server.CreateObject(&quot;MSWC.NextLink&quot;) <br />
    c=nl.GetPreviousDescription(&quot;links.txt&quot;) <br />
    Response.Write(&quot;Previous &quot;)<br />
    Response.Write(&quot;description is: &quot;)<br />
    Response.Write(c)<br />
    %&gt;<p>Previous description is: ASP Variables</p></td>
  </tr>
  <tr valign="top">
    <td>GetPreviousURL</td>
    <td> Returns the URL 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 URL 
    of the first page on the list</td>
    <td> &lt;%<br />
    dim nl,c<br />
    Set nl=Server.CreateObject(&quot;MSWC.NextLink&quot;) <br />
    c=nl.GetPreviousURL(&quot;links.txt&quot;) <br />
    Response.Write(&quot;Previous &quot;)<br />
    Response.Write(&quot;URL is: &quot;)<br />
    Response.Write(c)<br />
    %&gt;<p>Previous URL is: asp_variables.asp</p></td>
  </tr>
</table>
<br />
<hr />
<a href="asp_browser.asp"><img alt="previous" border="0" src="../images/btn_previous.gif" width="100" height="20" /></a>
<a href="asp_contentrotator.asp"><img alt="next" border="0" src="../images/btn_next.gif" width="100" height="20" /></a>

<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -