Örnek :
<font face="Verdana" size="2" color="#0000FF"><b>Listelenen Kayıtlar :</b></font>
<%
id=request.querystring("id")
intPage = cInt(Request.QueryString("page"))
If (intPage = 0) or (intpage="") then
intPage = 1
end if
liste_sayisi= 7
Set rs=Server.CreateObject("Adodb.Recordset")
Sorgu="Select * from topik where id="&id&" "
'On Error Resume Next
yna.Open Sorgu, bag, 1, 3
If rs.EOF Then
Response.write"İlgili Kayıta rastlanamadı"
response.end
Else
messagecount = rs.Recordcount
rs.PageSize = cint(liste_sayisi)
rs.AbsolutePage = intPage
sayfa1= rs.PageCount
%>
<font face="Verdana" size="2"><%=sfysirala()%></font>
<table border="0" width="100%" style="border-style: solid; border-width: 1" bordercolor="#C0C0C0">
<%
i=1
for j=1 to rs.pagesize
if rs.eof then exit for
baslik= rs("baslik")
%>
<%if i mod 2 then
renk="F2F2F2"
else
renk="ffffff"
end if
%>
<tr>
<td width="3%" bgcolor="#<%=renk%>"><%response.write i%></td>
<td width="97%" bgcolor="#<%=renk%>" colspan="2"><%=baslik%></td>
</tr>
<%
i=i+1
rs.movenext
next
end if
rs.close
set rs=nothing
%> <tr>
<td width="3%" bgcolor="#<%=renk%>">
</td>
<td width="24%" bgcolor="#<%=renk%>"><font face="Verdana" size="2"> <b>Toplam Kayıt:</b> <%=messagecount%> </font></td>
<td width="73%" bgcolor="#<%=renk%>"><font face="Verdana" size="2"><%=sfysirala()%></font> </td>
</tr>
</table>
Fonksiyonumuz : <%
Function sfysirala()
If (messagecount/ liste_sayisi) <> Fix(messagecount/ liste_sayisi) then
intposts = Fix(messagecount/ liste_sayisi) + 1
else
intposts = (messagecount/ liste_sayisi)
end if
if intPosts >= 1 then
Sayfa="Sayfa"
Response.Write "<br /><div style=""text-align=right;""><span class=""stort"">" & Sayfa & ": " & intPosts & " (</span>"
If intPage > 1 Then
Response.Write "<a href=""?page=1" & "&id=" & id& """> İlk Sayfa </a> ... "
Response.write "<a href=""?page=" & intPage-1 & "&id=" & id& """><<</a> "
End If
For i = intpage-4 to intpage+4
If i > intPosts Then Exit For
if i <> cint(intPage) Then
If i >= 1 Then
response.write "<a href=""?page=" & i &"&id=" & id& """>" & i & "</a> "
End If
else
response.write " <a href=""#"">[" & i & "]</a> "
end if
Next
If intPage + 1 =< intposts Then
Response.write "<a href=""?page=" & intPage+1 &"&id=" & id& """>>></a> "
Response.write " ... <a href=""?page=" & intPosts &"&id=" & id& """>Son Sayfa</a>"
End if
Response.Write "<span class=""stort"">)</span></div>"
end if
End Function
%>