点击"Next"
当前页面的总页数。
以下JavaScript :
function paging(x){
var x;
var myAjax = new Ajax.Updater('dvReport','process.asp',{method:'get',parameters:{mode:'search_pabx_report',x:x}});
}
x=request.QueryString("x")
Const NumPerPage = 500
If Request.QueryString("page") = "" then
if x<1 then
CurrentPage = 1
else
CurrentPage = x
End if
strSQL= "select * from pabx"
rs.Open strSQL, adoCon,1,1
if rs.recordcount>0 then
response.write("<table border=1><tr>")
response.Write("<th>Department</th><th>Name</th><th>Number</th></tr>")
if Not rs.EOF Then
rs.MoveFirst
rs.PageSize = NumPerPage
TotalPages = rs.PageCount
rs.AbsolutePage = CurrentPage
End If
Dim Count
count=0
If CurrentPage = 1 Then
Response.Write "Prev | "
Else
response.Write("<a href='javascript:void(0)'
onClick='javascript:paging(" & CurrentPage - 1 & ");'>Prev</a> | ")
End If
'Display NEXT page link, if appropriate
If CurrentPage = TotalPages Then
Response.Write "Next"
Else
response.Write("<a href='javascript:void(0)'
onClick='javascript:paging(" & CurrentPage + 1 & ");'>Next</a>")
End If
%>
<p><b><font size='2' >Displaying page<%=CurrentPage%>of
<%=TotalPages%>:</font></b></p><p>
<%
Do While Not rs.EOF and Count < rs.PageSize
Response.write("<tr>")
Response.Write("<td nowrap>" & rs("department") & " </td>")
Response.Write("<td nowrap>" & rs("Emp_Name") & " </td>")
Response.Write("<td nowrap>" & rs("ExtNo") & " </td>")
response.write("</tr>")
rs.MoveNext
Count = Count + 1
loop
else
response.Write("No Record Found")
end if
rs.close