Visualizzazione dei risultati da 1 a 5 su 5

Discussione: Paginazione record

  1. #1

    Paginazione record

    ciao!secondo voi dove'è che sbaglio in questa paginazione?
    grazie:
    <html>
    <head>
    <title>GESTIONE RECORD</title>
    </head>

    <body>


    <%
    RecordsPerPagina = 5
    page = Request("page")
    if page="" then page=1
    ' STRINGA SQL
    strRicerca = Request("ricerca")
    SQL = "SELECT * FROM listino WHERE prezzo LIKE '%" & strRicerca & "%'"
    'apri recordset
    ' paginazione
    rs.PageSize = RecordsPerPagina
    rs.AbsolutePage = page
    If rs.Eof=True or rs.Bof=True then
    Response.Write "

    Nessun risultato trovato</P>"
    Else
    For i=1 to RecordsPerPagina
    if Not rs.EOF then
    %>
    <table>
    <tr>
    <td width="82" valign="middle" align="center" bgcolor="#FFFFCC" height="30">">[img]cancella.gif[/img]"></td>
    <td width="31" valign="middle" align="center" bgcolor="#FFFFCC" height="30">">[img]modifica.gif[/img]"></td>
    <td width="162" bgcolor="#FFFFCC" height="30"><font size="2" face="Verdana"><%=rs("prezzo")%></font></td>
    <td width="164" bgcolor="#FFFFCC" height="30"><font size="2" face="Verdana"><%=rs("articolo")%></font></td>
    <td width="165" bgcolor="#FFFFCC" height="30"><font size="2" face="Verdana"><%=rs("codice")%></font></td>
    </tr>
    </table>


    <%
    rs.MoveNext
    end if
    Next
    End if
    %>

    <%
    Response.Write "

    Pagine: "
    For pag=1 to rs.PageCount
    Response.Write "<A href='index.asp?page=" & pag
    Response.Write "&" & Server.UrlEncode(strRicerca)
    Response.write "'>"
    Response.Write pag
    Response.Write "</A> "
    Next
    Response.Write "</P>"
    %>

    </body>
    </html>

  2. #2
    Utente di HTML.it L'avatar di Joe Taras
    Registrato dal
    Nov 2003
    residenza
    Taranto
    Messaggi
    955

    Re: Paginazione record

    Originariamente inviato da Andreass
    ciao!secondo voi dove'è che sbaglio in questa paginazione?
    grazie:
    <html>
    <head>
    <title>GESTIONE RECORD</title>
    </head>

    <body>


    <%
    RecordsPerPagina = 5
    page = Request("page")
    if page="" then page=1
    ' STRINGA SQL
    strRicerca = Request("ricerca")
    SQL = "SELECT * FROM listino WHERE prezzo LIKE '%" & strRicerca & "%'"
    'apri recordset
    ' paginazione
    rs.PageSize = RecordsPerPagina
    rs.AbsolutePage = page
    If rs.Eof=True or rs.Bof=True then
    Response.Write "

    Nessun risultato trovato</P>"
    Else
    For i=1 to RecordsPerPagina
    if Not rs.EOF then
    %>
    <table>
    <tr>
    <td width="82" valign="middle" align="center" bgcolor="#FFFFCC" height="30">">[img]cancella.gif[/img]"></td>
    <td width="31" valign="middle" align="center" bgcolor="#FFFFCC" height="30">">[img]modifica.gif[/img]"></td>
    <td width="162" bgcolor="#FFFFCC" height="30"><font size="2" face="Verdana"><%=rs("prezzo")%></font></td>
    <td width="164" bgcolor="#FFFFCC" height="30"><font size="2" face="Verdana"><%=rs("articolo")%></font></td>
    <td width="165" bgcolor="#FFFFCC" height="30"><font size="2" face="Verdana"><%=rs("codice")%></font></td>
    </tr>
    </table>


    <%
    rs.MoveNext
    end if
    Next
    End if
    %>

    <%
    Response.Write "

    Pagine: "
    For pag=1 to rs.PageCount
    Response.Write "<A href='index.asp?page=" & pag
    Response.Write "&" & Server.UrlEncode(strRicerca)
    Response.write "'>"
    Response.Write pag
    Response.Write "</A> "
    Next
    Response.Write "</P>"
    %>

    </body>
    </html>
    Ma hai degli errori o solo viene visualizzato qualcosa di +?

  3. #3
    no mi dicew solo imposs.visualizz.pagina

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Disabilita gli errori HTTP brevi dal menu strumenti --> opzioni internet > avanzate di IE.
    In ogni caso vedo un MoveNext senza Do while...

    Roby

  5. #5
    ok!
    grazie roby

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.