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
%>

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.