my.ASPItalia.com
ASP.NET
|
HTML5
|
LINQ e Entity Framework
|
Silverlight
|
Windows Phone
|
.NET Framework
|
Windows 8
|
Libro WP7
|
Libro HTML5
|
Corso HTML5
Iscriviti
Login
Newsletter
Home
Articoli
Script
Notizie
FORUM
Blogs
Media
Tutorials
Corsi
Libri
Eventi
Tags
Tutti i forum
Ricerca
FAQ
Fai una domanda
PAGINAZIONE LA VENDETTA!!
in
Classic ASP
>
ASP - base
Ultimo messaggio
forseforse
il 6 novembre 2004 alle 10:20
12 messaggi
dal 30 ottobre 2004
Ho apportato le modifiche aprendo il recordset come indicato:
Recordset1.CursorType = 3
Recordset1.CursorLocation = 3
ma l'impaginazione dei risultati non è altro che l'url &page=1 o 2 o 3 ecc...
Ma "page" è un comando che si aggiunge come funzione di spostamento tra l'indice delle pagine che dovrebbe creare o è solo una variabil?
perchè non si sposta a nessuna suddivisione di pagina ma da quello che vedo "page" lo considera solo come una variabile che contiene un numero e di conseguenza che spostamento mi dovrebbe fare nell' ipotetica paginazione ?
Di seguito riporto il codice con le modifiche apportate e con la supplica di farmi capire...
GRAZIE
<%
perpage=4
%>
<%
Dim page
page = "1"
If (Request.QueryString("varfotobuffa") <> "") Then
page = Request.QueryString("varfotobuffa")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
strRicerca = Request("QueryFotoBuffe")
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_fotoBuffeconnekt_STRING
Recordset1.Source = "SELECT * FROM QueryFotoBuffe WHERE Categoria = '" + Replace(page, "'", "''") + "' ORDER BY IDFotobuffa DESC"
Recordset1.CursorType = 3
Recordset1.CursorLocation = 3
Recordset1.LockType = 3
Recordset1.Open()
if not Recordset1.eof then
' esegui tutto il resto...
Recordset1_numRows = 0
end if
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 4
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%"><img src="../../images/index/struttura_categoria/menu_sopra_big.gif" width="10" height="20"></td>
<td width="98%" bgcolor="#2B70FF"><div align="center"><span class="sei_in_categoria_sms">SEi in foto buffe NELLA CATEGORIA
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<%=(Recordset1.Fields.Item("Categoria").Value)%>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %>
</span></div></td>
<td width="1%"><img src="../../images/index/struttura_categoria/menu_sopra_big_dx.gif" width="10" height="20"></td>
</tr>
<tr valign="top">
<td height="248" colspan="3"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabella_lista_categoria">
<tr>
<td height="248" valign="top"> <div align="center" class="link-spost">
<table width="100%" height="247" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><table width="100%" height="247" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" class="link-spost"><hr width="300" size="1" color="#0000FF">
<table width="100%" border="0">
<% sorte=0 %>
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %>
<% if sorte = 0 or sorte = 2 then %>
<tr>
<td width="40%">
<div align="right">
<a href="<%=(Recordset1.Fields.Item("fotobuffa").Value)%>" target="_blank"> <img src="<%=(Recordset1.Fields.Item("fotobuffa").Value)%>" width="120" height="120" border="0" > </a>
</div></td>
<% End if %>
<% if sorte = 1 or sorte = 3 then %>
<td width="30"> </td>
<td width="40%">
<div align="left">
<a href="<%=(Recordset1.Fields.Item("fotobuffa").Value)%>" target="_blank"> <img src="<%=(Recordset1.Fields.Item("fotobuffa").Value)%>" width="120" height="120" border="0" > </a>
</div></td>
</tr>
<% End if %>
<% sorte = sorte+1 %>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %>
</table></td>
</tr>
</table></td>
</tr>
</table>
<hr width="300" size="1" color="#0000FF">
<br>
<%
For pag= 1 to recordset1.PageCount
if page = pag then
'grassetto per la pagina corrente
Response.Write "<b>"
Response.Write "<A href='fotobuffe.asp?varfotobuffa=bambini&pos=0&page=" & pag
Response.write "'>"
Response.Write pag
Response.Write "</A> "
Response.Write "</b>"
else
'normale per le altre pagine
Response.Write "<A href='fotobuffe.asp?varfotobuffa=bambini&pos=0&page=" & pag
Response.write "'>"
Response.Write pag
Response.Write "</A> "
end if
Next
%>
</div></td>
</tr>
</table> </td>
</tr>
<tr>
<td><img src="../../images/index/struttura_categoria/menu_sotto_big_sx.gif" width="10" height="20"></td>
<td bgcolor="#2B70FF"> </td>
<td><img src="../../images/index/struttura_categoria/menu_sotto_big_dx.gif" width="10" height="20"></td>
</tr>
</table>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
Rispondi
Quoting
Salto rapido
Ultimi messaggi
Tutti i forum
Ricerca
Utenti online
ASP.NET
ASP.NET 2.0
ASP.NET 3.5
ASP.NET 4.0
.NET Framework
Silverlight
Windows Phone
Windows Presentation Foundation e WinForms
Windows Communication e Workflow
ASP - avanzato
ASP - base
SQL Server e MySQL
E-commerce
Hosting
Altri linguaggi e tecnologie
Windows Server, IIS & Security
Libri
OT
Commenti: blogs e notizie
Eventi
Torna al forum
| Feed
RSS
ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.
Community
Effettua il login!
Hai dimenticato la password?
UTENTI ONLINE
In primo piano
Rilasciato Visual Studio 11 Beta: scopri tutte le novità!
Windows 8 Consumer Preview: segui con noi la diretta
Dal 29 febbraio arriva WinRTItalia.com: tutto sullo sviluppo per Windows 8 e Metro
I più letti di oggi
Creare e gestire documenti XML con LINQ to XML
Le novità di ASP.NET 4.5 (Community Days 2012)
Evitare l'embedding di file resx per la localizzazione in ASP.NET
Tutorial ASP.NET 3.5
ASP.NET 4.0 in C# e VB
Forzare la chiusura dell'applicazione in Windows Phone 7
Importare namespace in Razor su ASP.NET MVC e ASP.NET Web Pages
Utilizzare il metodo Load per caricare entity nel DbContext
Tutorial Windows Phone 7.1
Media
Integrare l'applicazione nell'esperienza di Windows 8 con i contratti
Tile e notifiche in Windows 8
Tutti i media
In evidenza
Dal 29 febbraio arriva WinRTItalia.com: tutto sullo sviluppo per Windows 8 e Metro
Spostare il mouse ed eseguire il click programmaticamente in Silverlight 5.0
Logging in ASP.NET: le migliori soluzioni open-source per tracciare gli errori
Operatori di confronto in JavaScript: == e ===
Forzare la chiusura dell'applicazione in Windows Phone 7
Importare namespace in Razor su ASP.NET MVC e ASP.NET Web Pages
Utilizzare il metodo Load per caricare entity nel DbContext
Eseguire il lock del computer direttamente da Silverlight 5.0
MISC
I nostri autori
Collabora con noi!
Media Kit - Pubblicità sul nostro network