Salve
di seguito la parte della paginazione di un motore di ricerca,
Lo script così comè quando passo alla seconda pagina mi fa vedere: indietro 2 - 3 - 4 avanti
Invece come posso modificarlo in modo che mi facesse vedere il numero delle pagine passate esempio:
indietro 1 - 2 - 3 avanti anche mi se mi trovo alla 2 o terza pagina
codice:
<%
page = page
totPage = pagine_totali
Max = 9
startPage = page
EndPage = page + Max
if page > 1 then
Response.write("<a href=""search.asp?page="& page -1 &""">Indietro</a> ")
end if
if EndPage > totPage then EndPage = totPage
for i = StartPage to EndPage
If i = totPage then
Response.Write("")
Else
If i = page then
Response.Write("<b>" & i & "</b>")
else
Response.write ("<a href=""search.asp?page=" & i & """> " & i & " </a> ")
end if
end if
next
if page < totpage then
Response.write (" <a href=""search.asp?page=" & page +1 & """>Avanti</a> ")
end if
%>
Grazie