Paging
Using ASP to do things already more, but has not paid attention to this thing, today spent a little time to write some, easy to use later.
<%sub Listpagemenu (objrs,intrspagesize)
Dim Rstotal,rspagesize,rspagecount
If not IsObject (objRS) Then Exit sub:end if
If not IsNumeric (rspagesize) Then Exit sub:end if
If objRS.EOF and Objrs.bof Then EXIT sub:end if
Objrs.pagesize=intrspagesize
Rstotal=objrs.recordcount
Rspagecount=rs. PageCount
If rstotal<0 and (objRS.EOF and objRS. BOF)) Then
Rstotal=0
Do as Not objrs.eof
Rstotal=rstotal+1
Objrs.movenext
LOOP
End If
Intcurrentpage=trim (Request.QueryString ("page")) ' Get the ' value of Intcurrentpage
If intcurrentpage= "" or (not IsNumeric (intcurrentpage)) Then
Intcurrentpage=1
End If
Dim Istart,istop
Istart=1:istop=1
If Cint (intCurrentPage-3) >0 Then
Istart=intcurrentpage-3
Else
Istart=1
End If
Istop=istart+7
If Istop>rspagecount Then
Istop=rspagecount
End If
If Istop-7<istart and Istart>0 Then
Istart=istop-7
End If
Dim strURL
Strurl=request.servervariables ("Script_name")
If Instr (strURL, "?") >0 Then
Strurl=strurl & "&page="
Else
Strurl=strurl & "Page="
End If
Dim Previouspage,nextpage
If Intcurrentpage-1>0 Then
Previouspage=intcurrentpage-1
Else
Previouspage=1
End If
If Intcurrentpage+1<rspagecount Then
Nextpage=intcurrentpage+1
Else
Nextpage=rspagecount
End If%>
<table width= "98%" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
<td><a href= "<%=strurl%>1" style= "Text-decoration:none" ><font face= "Webdings" >9</font ></a></td>
<td><a href= "<%=strurl & previouspage%>" style= "Text-decoration:none" ><font face= "Webdings" ">7</font></a></td>
<td>
<%dim I
For I=istart to Istop step 1%>
<td><%response.write ("<a href= '" & strURL & I & "' style= ' Text-decoration:none ' >" & I & "</a>")%></td>
<%Next%>
</td>
<td><a href= "<%=strurl & NextPage%>" style= "Text-decoration:none" ><font face= "Webdings" >8</font></a></td>
<td><a href= "<%=strurl & rspagecount%>" style= "Text-decoration:none" ><font face= "Webdings" >:</font></a></td>
<td> </td>
<td> </td>
</tr>
</table>
<%end sub%>