Tutoriales ASP

ASP INICIO

Tutorial de WordPress

Introducción a las páginas web Razor de páginas web Diseño de páginas web Carpetas de páginas web Páginas web globales Formularios de páginas web Objetos de páginas web Archivos de páginas web Bases de datos de páginas web Ayudantes de páginas web Cuadrícula web de páginas web Gráficos de páginas web Correo electrónico de páginas web Seguridad de las páginas web Publicación de páginas web Ejemplos de páginas web Clases de páginas web

Maquinilla de afeitar ASP.NET

Introducción a la maquinilla de afeitar Sintaxis de la maquinilla de afeitar Variables de Razor C# Razor C# Bucles Razor C# Lógica Razor VB Variables Razor Bucles VB Razor VB Lógica

ASP clásico

Introducción ASP Sintaxis ASP Variables ASP Procedimientos ASP Condicionales ASP Bucle ASP Formularios ASP Cookies ASP Sesión ASP Aplicación ASP ASP #incluir ASP Global.asa ASP AJAX correo electrónico ASP Ejemplos de ASP

Referencia ASP

Funciones ASP VB Palabras clave ASP VB Respuesta ASP Solicitud ASP Aplicación ASP Sesión ASP Servidor ASP Error de ASP Sistema de archivos ASP flujo de texto ASP Unidad ASP Archivo ASP Carpeta ASP Diccionario ASP Rotador de anuncios ASP Cap del navegador ASP Enlace de contenido ASP Rotador de contenido ASP Referencia rápida ASP

ADO Tutorial

Introducción a ADO Conectar ADO Conjunto de registros ADO Pantalla ADO Consulta ADO Ordenar ADO Agregar Actualización de ADO ADO Eliminar Demostración de ADO Acelerar ADO

Objetos ADO

Comando ADO Conexión ADO ADO Error Campo ADO Parámetro ADO Propiedad ADO Registro ADO Conjunto de registros ADO Corriente ADO Tipos de datos ADO

Componente de enlace de contenido ASP


Más ejemplos


Cree una tabla de contenido.


Utilice el componente de enlace de contenido para navegar entre las páginas de un archivo de texto.


Componente de enlace de contenido ASP

¡El componente ASP Content Linking se usa para crear un sistema de navegación rápido y fácil!

El componente de vinculación de contenido devuelve un objeto Nextlink que se utiliza para contener una lista de páginas web para navegar.

Sintaxis

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

Ejemplo de enlace de contenido ASP

Primero creamos un archivo de texto - "links.txt":

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

El archivo de texto de arriba contiene las páginas por navegar. Las páginas deben enumerarse en el mismo orden en que desea que se muestren y también debe contener una descripción para cada nombre de archivo (utilice la tecla de tabulación para separar el nombre del archivo de la descripción).

Nota: si desea agregar una página o cambiar el orden de las páginas en la lista; solo tienes que modificar el archivo de texto! ¡La navegación se corregirá automáticamente!

Luego creamos un archivo de inclusión, "nlcode.inc". El archivo .inc crea un objeto NextLink para navegar entre las páginas enumeradas en "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>")
%>

En cada una de las páginas .asp enumeradas en el archivo de texto "links.txt", coloque una línea de código: <!-- #include file="nlcode.inc"--> . Esta línea incluirá el código en "nlcode.inc" en cada página listada en "links.txt" y la navegación funcionará.



Métodos del componente de enlace de contenido ASP

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

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