|
<%Dim mostrar, cant_paginas, pagina_actual, registro_mostrado, I
mostrar = 10
If Request.QueryString("page") = "" Then
pagina_actual = 1
Else
pagina_actual = CInt(Request.QueryString("page"))
End If
registros.PageSize = mostrar
registros.CacheSize = mostrar
sql = "select * from ciec_notaprensa where tipo=2 and status=1 order by id desc"
registros.open sql,conexion,3,1
cant_paginas = registros.PageCount
If pagina_actual > cant_paginas Then pagina_actual = cant_paginas
If pagina_actual < 1 Then pagina_actual = 1
If cant_paginas = 0 Then
Response.Write "No hay registros..."
Else
registros.AbsolutePage = pagina_actual
%>
<%' Ahora mostramos los enlaces a las otras páginas con el resto de los registros...
If pagina_actual > 1 Then
%>
[<< Anterior]
<%
End If
' mostramos la paginacion por numeros de página
For I = 1 To cant_paginas
If I = pagina_actual Then%>
<%= I %>
<%Else%>
<%= I %>
<%End If
Next 'I
If pagina_actual < cant_paginas Then%>
[Próximo >>]
<%End If%>
|