asp 大資料量分頁執行個體代碼

來源:互聯網
上載者:User

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html><head><title>後台</title>
<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教程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=網頁特效>
<!--
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>
</head>
<body>
<table cellspacing=0 cellpadding=0 width="100%" border=0>
  <tbody>
  <tr>
    <td align=right valign=top><table cellspacing=0 cellpadding=0 width="100%" border=0>
          <tbody>
            <tr>
              <td height=14></td>
            </tr>
            <tr>
              <td height=14></td>
            </tr>
            <tr>
              <td height="168" valign="top">
                <table width="814" border=0 cellpadding=0 cellspacing=1 bgcolor="#666666">
                  <tbody>
                    <tr>
                     
                      <td width=57
                height=24 align=middle background=images/stab-ub.gif><strong>帳號</strong><img height=1
                  src="images/break-el.gif" width=1></td>
                    <td width="135" align=middle
                  background=images/stab-ub.gif><strong>公司</strong><img height=1
                  src="images/break-el.gif" width=1></td>
                    <td width=63 align=middle
                  background=images/stab-ub.gif><strong>連絡人</strong><img height=1
                  src="images/break-el.gif" width=1></td>
                    <td width="86" align=middle
                  background=images/stab-ub.gif><strong>行動電話</strong><img height=1
                  src="images/break-el.gif" width=1></td>
                    <td width="95" align=middle
                  background=images/stab-ub.gif><strong>註冊時間</strong></td>
                    <td width="89" align=middle
                  background=images/stab-ub.gif><strong>登陸時間</strong></td>
                    <td width=60 align=middle
                  background=images/stab-ub.gif><strong></strong><img height=1
                  src="images/break-el.gif" width=1></td>
                    <td width=41 align=middle
                  background=images/stab-ub.gif><strong>狀態</strong><img height=1
                  src="images/break-el.gif" width=1></td>
                    <td width=178 align=middle
                  background=images/stab-ub.gif><strong></strong><img height=1
                  src="images/break-el.gif" width=1></td>
                    </tr>
                   
                   
                    <%
for i = 1 to psize
if rs.eof then exit for
%>   
                   
                    <tr>
                     
                      <td height=20 align=middle bgcolor="#ffffff"><a href="edit.jsp教程?id=<%=rs("id")%>"><%=rs("userid")%></a></td>
                    <td bgcolor="#ffffff">&nbsp;<%=rs("company")%></td>
                    <td bgcolor="#ffffff">&nbsp;<%=rs("truename")%><img height=1
                  src="images/break-el.gif" width=1></td>
                    <td bgcolor="#ffffff">&nbsp;<%=rs("tel2")%><img height=1
                  src="images/break-el.gif" width=1></td>
                    <td bgcolor="#ffffff"><%=rs("regtime")%></td>
                    <td bgcolor="#ffffff"><%=rs("dltime")%></td>
                    <td align=middle bgcolor="#ffffff"><img height=1
                  src="images/break-el.gif" width=1></td>
                    <td align=middle bgcolor="#ffffff"><%if rs("zt")=0 then
                    response.write "正常"
                    else
                      response.write "<font color=red>禁止</font>"
                      end if%></td>
                    <td align=middle bgcolor="#ffffff"></td>
                    </tr>
                   
<%
rs.movenext
next
%>
                    <tr>
                      <td colspan=10><table width="100%" border="0" cellspacing="0" cellpadding="4">
                       
                        <tr>
                          <td width="41%" height="25" bgcolor="#ffffff">共<font color="#ff0000"><%= rcount %></font>條 分<font color="#ff0000"><%= pcount %></font>頁 | 當前第<font color="#ff0000"><%= pageno %></font>頁</td>
                          <td width="13%" bgcolor="#ffffff"></td>
                          <td width="46%" align="right" bgcolor="#ffffff">
                            <%
          if pageno > 1 then
           response.write "<a href=""?pageno=1&action="&action&"&key="&key&""">首頁</a>&nbsp;"
           response.write "<a href=""?pageno="&pageno-1&"&action="&action&"&key="&key&""">上頁</a>&nbsp;"   
          else
           response.write "首頁&nbsp;"
           response.write "上頁&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&""">下頁</a>&nbsp;"
           response.write "<a href=""?pageno="&pcount&"&action="&action&"&key="&key&""">尾頁</a>"  
          else
           response.write "下頁&nbsp;"
           response.write "尾頁"
          end if
           %>          </td>
            </tr>
                       
                      </table></td>
                  </tr></tbody>
              </table></td>
            </tr></tbody>
      </table></td>
    </tr></tbody></table>
</body></html>
<%
rs.close
set rs = nothing
%>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.