Paginazione
Lo script mostra come usare la paginazione per visualizzare dei record di un database:
<%
RecordsPerPagina = 5
page = Request("page")
if page="" then page=1
' STRINGA SQL
strRicerca = Request("ricerca")
SQL = "SELECT * FROM Ricerca WHERE Descrizione LIKE '%"
& strRicerca & "%'"
'apri recordset
' paginazione
rs.PageSize = RecordsPerPagina
rs.AbsolutePage = page
If rs.Eof=True or rs.Bof=True then
Response.Write "<P>Nessun risultato trovato</P>"
Else
For i=1 to RecordsPerPagina
if Not rs.EOF then
'mostra record
rs.MoveNext
end if
Next
End if
%>
Infine, per aggiungere una barra di navigazione tra le pagine con
risultati: <%
Response.Write "<P><B>Pagine:</B> "
For pag=1 to rs.PageCount
Response.Write "<A href='pagina.asp?page=" & pag
Response.Write "&" & Server.UrlEncode(strRicerca)
Response.write "'>"
Response.Write pag
Response.Write "</A> "
Next
Response.Write "</P>"
%>
Script ASP
-
ASP.NET
Contatori (ASP)
Chat (ASP)
Database
Date e Ore -
Email (ASP)
File ASP
Gestione banner
Grafica e Layout
Script matematici
Articoli ASP | Libri ASP | Manuale ASP
