ASP large amount of data paging instance code

Source: Internet
Author: User

<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<meta http-equiv=content-type content= "text/html; charset=gb2312 ">
<%
Set Rs=server.createobject ("Adodb.recordset")
sql = "Select Userid,company,truename,tel,regtime,dltime,zt,id from [usertable] ORDER by id DESC"
Rs.Open sql,conn,1,1
Rs.pagesize = 10
PS Tutorial ize = rs.pagesize
Pcount = Rs.pagecount
Rcount = Rs.recordcount
Action=request ("Action")
Key=request ("key")
PageNo = CInt (Request.QueryString ("PageNo"))
If PageNo < 1 Then
PageNo = 1
ElseIf pageno > Pcount Then
PageNo = Pcount
End If
thepage = (pageno-1) *psize
If not rs.eof then Rs.absolutepage = PageNo
%>
<script language= Web page Special effects >
<!--
function Mm_jumpmenu (targ,selobj,restore) {//v3.0
Eval (targ+ "location=" "+selobj.options[selobj.selectedindex].value+");
if (restore) selobj.selectedindex=0;
}
-->
</script>
<meta content= "Mshtml 6.00.3790.2993" name=generator>

<body>
<table cellspacing=0 cellpadding=0 width= "100%" border=0>
<tbody>
<tr>
&LT;TD align=right valign=top><table cellspacing=0 cellpadding=0 width= "100%" border=0>
<tbody>
<tr>
&LT;TD height=14></td>
</tr>
<tr>
&LT;TD height=14></td>
</tr>
<tr>
&LT;TD height= "valign=" "Top" >
<table width= "814" border=0 cellpadding=0 cellspacing=1 bgcolor= "#666666" >
<tbody>
<tr>

&LT;TD width=57
height=24 align=middle background=images/stab-ub.gif><strong> Account </strong>Src= "Images/break-el.gif" width=1></td>
&LT;TD width= "135" Align=middle
Background=images/stab-ub.gif><strong> company </strong>Src= "Images/break-el.gif" width=1></td>
&LT;TD width=63 Align=middle
background=images/stab-ub.gif><strong> Contact Person </strong>Src= "Images/break-el.gif" width=1></td>
&LT;TD width= "Align=middle"
background=images/stab-ub.gif><strong> Mobile phone </strong>Src= "Images/break-el.gif" width=1></td>
&LT;TD width= "Align=middle"
Background=images/stab-ub.gif><strong> Registration Time </strong></td>
&LT;TD width= "Align=middle"
Background=images/stab-ub.gif><strong> Landing Time </strong></td>
&LT;TD width=60 Align=middle
Background=images/stab-ub.gif><strong></strong>Src= "Images/break-el.gif" width=1></td>
&LT;TD width=41 Align=middle
background=images/stab-ub.gif><strong> State </strong>Src= "Images/break-el.gif" width=1></td>
&LT;TD width=178 Align=middle
Background=images/stab-ub.gif><strong></strong>Src= "Images/break-el.gif" width=1></td>
</tr>


<%
For i = 1 to Psize
If Rs.eof then exit for
%>

<tr>

&LT;TD height=20 align=middle bgcolor= "#ffffff ><a href=" edit.jsp tutorial? Id=<%=rs ("id")%> "><%=rs" (" UserID ")%></a></td>
&LT;TD bgcolor= "#ffffff" >&nbsp;<%=rs ("Company")%></td>
&LT;TD bgcolor= "#ffffff" >&nbsp;<%=rs ("Truename")%>Src= "Images/break-el.gif" width=1></td>
&LT;TD bgcolor= "#ffffff" >&nbsp;<%=rs ("Tel2")%>Src= "Images/break-el.gif" width=1></td>
&LT;TD bgcolor= "#ffffff" ><%=rs ("Regtime")%></td>
&LT;TD bgcolor= "#ffffff" ><%=rs ("Dltime")%></td>
&LT;TD align=middle bgcolor= "#ffffff" >Src= "Images/break-el.gif" width=1></td>
&LT;TD align=middle bgcolor= "#ffffff" ><%if rs ("ZT") =0 Then
Response.Write "Normal"
Else
Response.Write "<font color=red> Forbidden </font>"
End If%></td>
&LT;TD align=middle bgcolor= "#ffffff" ></td>
</tr>

<%
Rs.movenext
Next
%>
<tr>
&LT;TD colspan=10><table width= "100%" border= "0" cellspacing= "0" cellpadding= "4" >

<tr>
&LT;TD width= "41%" height= "bgcolor=" #ffffff "> Total <font color=" #ff0000 "><%= rcount-%></font> Strips <font color= "#ff0000" ><%= pcount%></font> Page | Current <font color= "#ff0000" ><%= pageno%></font> page </td>
&LT;TD width= "13%" bgcolor= "#ffffff" ></td>
&LT;TD width= "46%" align= "right" bgcolor= "#ffffff" >
<%
If PageNo > 1 Then
Response.Write "<a href=" "pageno=1&action=" &action& "&key=" &key& "" "> Home </a> &nbsp; "
Response.Write "<a href=" "pageno=" &pageno-1& "&action=" &action& "&key=" &key& "" "> Prev </a>&nbsp;"
Else
Response.Write "Home &nbsp;"
Response.Write "Prev &nbsp;"
End If
%>
<select name= "menu2" onchange= "Mm_jumpmenu" (' Self ', this,0) "style=" width:40px; >
<% for i = 1 to Pcount%>
<option value= "? pageno=<%= I%>&action=<%=action%>&key=<%=key%>" <% if i = PageNo Then Response.Write "Selected"%>><%=i%></option>
<% Next%>
</select>

<%
If PageNo < Pcount Then
Response.Write "<a href=" "pageno=" &pageno+1& "&action=" &action& "&key=" &key& "" "> Next page </a>&nbsp;"
Response.Write "<a href=" "pageno=" &pcount& "&action=" &action& "&key=" &key& "" > Last </a> "
Else
Response.Write "Next Page &nbsp;"
Response.Write "Last"
End If
%> </td>
</tr>

</table></td>
</tr></tbody>
</table></td>
</tr></tbody>
</table></td>
</tr></tbody></table>
</body>
<%
Rs.close
Set rs = Nothing
%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.