给你个下拉框选择跳转页,我用的基本上都这个。
自己把里面代码整理出来:
<html xmlns="http://www.
<head>
<%Server.ScriptTimeout=9999%>
<!-- #include file="../inc/guest_constsql.asp" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=qbx_title%></title>
<link href="../css/styls.css" rel="stylesheet" type="text/css">
<script language="javascript">
function pageii(i){
document.gopage.currentpage.value=i;
document.gopage.submit();
}
</script>
</head>
<body>
<!--#include file="../inc/head.asp"-->
<table width="995" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="229" align="center" valign="top"><table width="229" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="29" background="../img/left1.jpg" style="font-size:13px; font-weight:bold;"> 推荐供求信息</td>
</tr>
<tr>
<td height="195" align="center" valign="top" background="../img/left2.jpg">
<table width="220" border="0" cellspacing="0" cellpadding="0">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from trade where check=true and (trade_sort=0 or trade_sort=1) and trade_show=true order by edit_time
desc ,addtime desc"
rs.open sql,conn,1,1
if rs.eof then
response.write "<tr><td
height='30' align='center'>暂无内容</td></tr>"
else
for i=1 to 7
%>
<tr>
<td width="45" height="27" align="center">[<%
if rs("trade_sort")=0 then
response.write "<span style='color:#00f'>供应</span>"
elseif rs("trade_sort")=1 then
response.write "<span style='color:#f00'>求购</span>"
end if
%>]</td>
<td width="175" height="27" align="left" valign="middle"><%if rs("trade_sort")=0 then%>
<a href="../com_show/provide_show_one.asp?trade_id=<%=rs("trade_id")%>&com_id=<%=rs("com_id")%>" target="_blank">
<%else%>
<a href="../com_show/wanted_show_one.asp?trade_id=<%=rs("trade_id")%>&com_id=<%=rs("com_id")%>" target="_blank">
<%end if%><%
if len(trim(rs("trade_title")))>13 then
response.Write left(rs("trade_title"),12)&"…"
else
response.Write rs("trade_title")
end if
%></a></td>
</tr>
<% rs.movenext
if rs.eof then exit for
next
end if
rs.close
set rs=nothing
%>
</table>
</td>
</tr>
<tr>
<td height="1" bgcolor="#B0780B"></td>
</tr>
</table>
<table width="229" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"></td>
</tr>
</table>
<!--#include file="../inc/index_left.asp"-->
</td>
<td width="6" align="center" valign="top"></td>
<td width="539" align="center" valign="top"><table width="539" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="29" align="center" background="../img/mid1.jpg"><table width="530" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="382" height="29"> 首页 >> 商机
<%
trade_sort=trim(request("trade_sort"))+""
if trade_sort="0" then
response.write "> 供应"
elseif trade_sort="1" then
response.write "> 求购"
end if
%></td>
<td width="148" align="center" valign="middle"><a href="index.asp?trade_sort=1">求购</a><span style="padding-top:5px; color:#333; font-size:8px;"> ■ </span><a href="index.asp?trade_sort=0">供应</a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="1000" align="center" valign="top" background="../img/mid2.jpg">
<table width="539" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1055" align="center" valign="top">
<table width="530" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5" ></td>
</tr>
</table>
<table width="530" border="0" cellspacing="0" cellpadding="0">
<%
if trade_sort="0" then
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from trade where check=true and trade_sort=0 order by edit_time
desc ,addtime desc"
%>
<tr>
<td height="30" colspan="2" bgcolor="#E8E8E8" style="font-size:13px; font-weight:bold;"> 供 应</td>
</tr>
<% end if %>
<%
if trade_sort="1" then
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from trade where check=true and trade_sort=1 order by edit_time
desc ,addtime desc"
%>
<tr>
<td height="30" colspan="2" bgcolor="#E8E8E8" style="font-size:13px; font-weight:bold;"> 求 购</td>
</tr>
<%
end if
if trade_sort="" then
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from trade where check=true and (trade_sort=1 or trade_sort=0) order by edit_time
desc ,addtime desc"
end if
rs.open sql,conn,1,1
if rs.eof then
rs.close
response.write "<tr><td> 还没有记录!</td></tr>"
else
const maxperpage=33'定义每一页显示的数据记录的常量
dim currentpage '定义当前页的变量
rs.pagesize=maxperpage
currentpage=request("currentpage")
if currentpage="" or not Isnumeric(currentpage) then
currentpage=1
elseif currentpage<1 then
currentpage=1
else
currentpage=clng(currentpage)
if currentpage > rs.pagecount then
currentpage=rs.pagecount
end if
end if
'如果变量c1urrentpage的数据类型不是数值型
'就1赋给变量c1urrentpage
if not isnumeric(currentpage) then
currentpage=1
end if
dim totalput,n '定义变量
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then
n=1
end if
rs.move(currentpage-1)*maxperpage
i=0
do while i< maxperpage and not rs.eof
%>
<tr>
<td width="440" height="30" align="left" valign="middle"> <img src="../index/images/b.jpg" width="4" height="6"> [<%
if rs("trade_sort")=0 then
response.write "<span style='color:#00f'>供应</span>"
else
response.write "<span style='color:#f00'>求购</span>"
end if
%>]
<%if rs("trade_sort")=0 then%>
<a href="../com_show/provide_show_one.asp?trade_id=<%=rs("trade_id")%>&com_id=<%=rs("com_id")%>" target="_blank">
<%else%>
<a href="../com_show/wanted_show_one.asp?trade_id=<%=rs("trade_id")%>&com_id=<%=rs("com_id")%>" target="_blank">
<%end if%>
<%if len(rs("trade_title"))>30 then
response.write left(rs("trade_title"),28)&"…"
else
response.write rs("trade_title")
end if
%></a></td>
<td width="90" height="30" align="center"><%=rs("addtime")%></td>
</tr>
<tr>
<td height="1" colspan="2" background="../img/line.jpg"></td>
</tr>
<%
i=i+1
rs.movenext
loop
rs.close
end if
%>
</table>
</td>
</tr>
<tr>
<td height="53" align="center" valign="middle">
<table width="511" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="371">
共有<%=totalput%>条信息
<% k=currentpage
if k<>1 then%>
[<a class="link" href="javascript:pageii(1);">首页</a>]
[<a class="link" href="javascript:pageii(<%=k-1%>);">上一页</a>]
<%else%>
[首页] [上一页]
<%end if%>
<%if k<>n then%>
[<a class="link" href="javascript:pageii(<%=k+1%>);">下一页</a>]
[<a class="link" href="javascript:pageii(<%=n%>);">尾页</a>]
<%else%>
[下一页] [尾页]
<%end if%>
页次:<%=currentpage%>/<% =n%>
</td>
<form action="" method="post" name="pag" style="margin:0px;">
<td width="140" height="23"> <p>转到:
<select onChange="javascript:pageii(document.pag.pag.value)" size="1" id="pag" name="pag" style="background-attachment: scroll; background-repeat: repeat; font-size: 9pt; height: 23; width: 96; background-color: #FFFFFF; border: 1 solid #000000; background-position: none 0%; width:70px;">
<%
i=1
do while not i > n
%>
<option value="<%=I%>" <%if i=currentpage then %>selected<%end if%>>第
<%=i%> 页</option>
<%
i=i+1
loop
%>
</select>
</td>
</form>
<TR>
</TR>
</table>
<form action="" method="post" name="gopage" style="margin:0px;">
<input type="hidden" name="currentpage" value="">
<input type="hidden" name="id" value="<%=id%>">
</form>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="1" bgcolor="#BD8A2E"></td>
</tr>
</table></td>
<td width="6" align="center" valign="top"></td>
<td width="215" align="center" valign="top">
<table width="215" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1" bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td height="220" align="center" background="../img/right1.jpg"><img src="../img/right1_1.jpg" width="207" height="214"></td>
</tr>
<tr>
<td height="1" bgcolor="#CCCCCC"></td>
</tr>
</table>
<table width="215" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="10"></td>
</tr>
<tr>
<td height="36" background="../img/right2.jpg"> </td>
</tr>
<tr>
<td height="240" align="center" valign="top" background="../img/right1.jpg">
<table width="210" border="0" cellspacing="0" cellpadding="0">
<% set rs=server.createobject("adodb.recordset")
sql="select * from news where cateid=1 and (second_cateid=40 or second_cateid=41 or second_cateid=42) order by id desc"
rs.open sql,conn,1,1
if rs.eof then
response.write "<tr><td> 还没有记录!</td></tr>"
else
for i=1 to 9
%>
<tr>
<td width="20" height="26" align="center"><img src="../index/images/b.jpg" width="4" height="6"></td>
<td width="190" height="26" align="left"><a href="../zx/new_show.asp?id=<%=rs("id")%>" target="_blank"><%
if len(trim(rs("title")))>14 then
response.Write left(rs("title"),12)&"…"
else
response.Write rs("title")
end if
%></a></td>
</tr>
<%rs.movenext
if rs.eof then exit for
next
end if
rs.close
set rs=nothing
%>
</table>
</td>
</tr>
<tr>
<td height="1" bgcolor="#CCCCCC"></td>
</tr>
</table>
<table width="215" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"></td>
</tr>
<tr>
<td height="70"><img src="../img/right3.jpg" width="215" height="60"></td>
</tr>
<tr>
<td height="70"><img src="../img/right4.jpg" width="215" height="60"></td>
</tr>
<tr>
<td height="5"></td>
</tr>
</table>
<!--#include file="../inc/bbsGoodTopic.asp"-->
</td>
</tr>
</table>
<!--#include file="../inc/foot.asp"-->
</body>
</html>