Foros del Web » Programando para Internet » ASP Clásico »

Paginar

Estas en el tema de Paginar en el foro de ASP Clásico en Foros del Web. HOLA ALGUIEN TIENE UN EJEMPLO PARA PAGINAR QUE NO SEA MUY COMPLICADO, PORFAVOR. CARLA...
  #1 (permalink)  
Antiguo 22/02/2002, 09:35
 
Fecha de Ingreso: enero-2002
Mensajes: 97
Antigüedad: 22 años, 5 meses
Puntos: 0
Paginar

HOLA ALGUIEN TIENE UN EJEMPLO PARA PAGINAR QUE NO SEA MUY COMPLICADO, PORFAVOR.

CARLA
  #2 (permalink)  
Antiguo 22/02/2002, 09:36
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Re: Paginar

www.aspfacil.com

ahi hay uno muy sencillo

saludos :) ;)
  #3 (permalink)  
Antiguo 22/02/2002, 16:06
 
Fecha de Ingreso: febrero-2002
Mensajes: 184
Antigüedad: 22 años, 3 meses
Puntos: 0
Re: Paginar

Aquí te mando uno que hice hace poco. Es muy humilde, sólo "siguiente" y "anterior"
Te lo mando en 2 mensajes:

<%response.buffer = true%>
<html>

<body bgcolor="#003366" marginheight="0" topmargin="0">
<!--#Include file="adovbs.inc" -->



<% set oConn=Server.CreateObject("ADODB.Connection&q uot;)
set rs=Server.CreateObject("ADODB.Recordset" )
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:/inetpub/wwwroot/claves.mdb;"
rs.open "archivos", Oconn, adopenstatic, adcmdtable

numero_pagina=0
if request.form <> "" then
numero_pagina=request.form("pagina")
end if

cantidad_registros=1

if numero_pagina<>0 then
for i=1 to numero_pagina*2
rs.movenext
next
end if

do while (not rs.eof and cantidad_registros <= 2) %>
<% response.write(rs("enunciado"))
response.write("<br>")
rs.movenext
cantidad_registros=cantidad_registros + 1

%>
<% loop %>
<%if rs.eof then

proxima_pagina=0
else
proxima_pagina=1
end if %>

<br>

<% if cantidad_registros=3 and proxima_pagina=1 and numero_pagina=0 then %>

<form name="paginacion" method="post" action="http://enrique/default.asp" >
<input type="submit" value="siguiente>>">
<input type="hidden" name="pagina" value="<% response.write(numero_pagina + 1)%>">

</form>
<% end if %>
  #4 (permalink)  
Antiguo 22/02/2002, 16:09
 
Fecha de Ingreso: febrero-2002
Mensajes: 184
Antigüedad: 22 años, 3 meses
Puntos: 0
Re: Paginar

Segunda y última parte:



<% if cantidad_registros=3 and proxima_pagina=1 and numero_pagina<>0 then %>
<table>
<tr>
<td>
<form name="paginacion" method="post" action="http://enrique/default.asp" >
<input type="submit" value="<<anterior">
<input type="hidden" name="pagina" value="<% response.write(numero_pagina - 1)%>">
</form>
<td>
<form name="paginacion" method="post" action="http://enrique/default.asp" >
<input type="submit" value="siguiente>>">
<input type="hidden" name="pagina" value="<% response.write(numero_pagina + 1)%>">
</form>
</tr>
</table>
<% end if %>
<% if proxima_pagina=0 and numero_pagina<>0 then %>

<form name="paginacion" method="post" action="http://enrique/default.asp" >
<input type="submit" value="<<anterior">
<input type="hidden" name="pagina" value="<% response.write(numero_pagina - 1)%>">
</form>
<% end if %>
<% rs.movefirst%>



</body>
</html>


Espero que te sirva. Cualquier problemita mandá un mensaje ;)

Enrique2 :)
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:38.