Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it L'avatar di [trodat]
    Registrato dal
    Oct 2004
    Messaggi
    2,135

    Paginazione [Script Roby72]

    Ho scaricato lo script per la paginazione a firma Roby72; ma quando chiedo i dati della seconda pagina restituisce che non ci sono valori, dove sbaglio?
    codice:
    iPageSize = 13 'NUMERO RECORD PER PAGINA
    
    			If Request.QueryString("page") = "" Then
    				iPageCurrent = 1
    			Else
    				iPageCurrent = CInt(Request.QueryString("page"))
    			End If
    
    SQLDown = "......"
    
    Set RECDown = server.CreateObject("ADODB.Recordset") 
    RECDown.Open SQLDown,cn,1,3 
    
    RECDown.PageSize = iPageSize
    RECDown.CacheSize = iPageSize
    
    reccount = RECDown.recordcount
    iPageCount = RECDown.PageCount
    
    dim numRecords 
    numRecords = RECDown.RecordCount 
    
    If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
    			If iPageCurrent < 1 Then iPageCurrent = 1
    
    			If iPageCount = 0 Then
    				Response.Write "
    
    <table><td><font face='verdana' size='2' color='#000000'>Non sono stati trovati giocatori.</td></table></p>"
    			Else
    				RECDown.AbsolutePage = iPageCurrent
    				iRecordsShown = 0
    
    %>
    
    <%'INIZIO INTESTAZIONI TABELLA %>
    ...
    
    <%'FINE INTESTAZIONI TABELLA %>
    
    <%'INIZIO VALORI TABELLA %>
    
    <%
    if not RECDown.eof and iRecordsShown < iPageSize then 
      WHILE Not RECDown.EOF
    %>
    ...
    
    <%'FINE VALORI TABELLA %>
    
    <% 
    RECdown.MoveNext
    Wend
    
    end if
    end if
    end if
    
    RECDown.Close
    Set RECdown = Nothing
    cn.close
    Set cn=nothing
    %>
    
          </table>
            </center>
    
    </div>
    <%If ipagecount <> 1 Then%>
    				<center>
    				<table>
    					<tr valign="middle">
    						<td width="50%" align="center" valign="middle"><font face="verdana" size="1" color="#000000">
    							[
    							<%if iPageCurrent-2 > 0 and iPageCurrent > 2 then%>
    								[img]images/first.gif[/img]
    							<%end if%>
    							<%if iPageCurrent > 1 then%>
    								[img]images/pre.gif[/img]
    							<%end if%>
    							<%if iPageCount > 2 then
    								if iPageCurrent-2 < 1 then da_pag = 1 else da_pag = iPageCurrent-2
    								if iPageCurrent+2 > iPageCount then fino_a_pag = iPageCount else fino_a_pag = iPageCurrent+2
    							else
    								da_pag = 1
    								fino_a_pag = iPageCount
    							end if%>
    							<%for i = da_pag to fino_a_pag%>
    								<%if i = iPageCurrent then%>
    									<font color="red"><%=i%></font>
    								<%else%>	
    									<%=i%>
    								<%end if%>	
    							<%next%>
    							<%if iPageCurrent > 0 and iPageCurrent < iPageCount then%>
    								[img]images/next.gif[/img]
    							<%end if%>	
    							<%if iPageCurrent+1 < iPageCount then%>
    								[img]images/last.gif[/img]
    							<%end if%>	
    							]
    						</font></td>
    					</tr>
    					<tr>
    						<td colspan="2" align="center"><font face="verdana" size="1" color="#000000">
    							<center>
    							Pagina
    								<font color="#FF0000"><%=iPageCurrent%></font>
    								di
    								<font color="#FF0000"><%=iPageCount%></font>
    							</center>
    						</font></td>
    					</tr>
    				</table>
    				</center>
    			<%end if%>

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    L'unica cosa importante non l'hai postata... la query!
    Se non passi gli elementi con i quali realizzi la query (quelli che hai dopo il WHERE) nei link della paginazione è normali che non trovi nulla oltre la prima pagina.

    Roby

  3. #3
    Utente di HTML.it L'avatar di [trodat]
    Registrato dal
    Oct 2004
    Messaggi
    2,135
    OK grazie Roby era proprio la query, adesso va bene!

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.