| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 501 人关注过本帖
标题:跳转页问题
只看楼主 加入收藏
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
 问题点数:0 回复次数:3 
跳转页问题

大家帮忙看看为什么红色的代码实现不了跳转功能?

<!--#include file="../inc/conn_other.asp"--><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<link href="../../css/1.css" rel="stylesheet" type="text/css">
<link href="../../css/2.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-image: url(../../images/bg1111.gif);
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style></head>
<body>
<p>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="212" height="550">&nbsp;</td>
<td width="780" align="center" valign="top"><TABLE WIDTH=780 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<!--DWLayoutTable-->
<TR>
<TD width="509" height="218" valign="top" background="../../images/left_bg.gif"><table width="509" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table> <table width="509" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="99%" height="205" border="0" cellpadding="0" cellspacing="1">
<%

set rs=server.createobject("adodb.recordset")

page=request.querystring("page")
if page="" then page=1
if not(isnumeric(page)) then page=1
if page<1 then page=1
page=int(page)

sql="select * from zhuanjia order by Product_Date DESC"
rs.open sql,conn,3,1
if rs.eof then
%>
<tr bgcolor="#EEEEEE">
<td height="24" colspan="2"><div align="center"><font color="#FF0000" size="3">暂时没有专家!!!</font></div></td>
</tr>
<%
response.end
else
rs.pagesize=5
totalrec=rs.recordcount
totalpage=rs.pagecount
if page>totalpage then page=totalpage
rs.absolutepage=page
i=0

dim id(),xingming(),zhaopian(),zhicheng(),jianjie(),dizhi()
do while not rs.eof and (i<rs.pagesize)
i=i+1
redim preserve id(i),xingming(i),zhaopian(i),zhicheng(i),jianjie(i),dizhi(i)
id(i)=rs("id")
xingming(i)=rs("xingming")
zhaopian(i)=rs("zhaopian")
zhicheng(i)=rs("zhicheng")
jianjie(i)=rs("jianjie")
dizhi(i)=rs("dizhi")
rs.movenext
loop
end if
rs.close
%>
<tr>
<%for i = 1 to ubound(id)%>
<td width="31%" HEIGHT="140" align="center" valign="middle" bgcolor="#EEEEEE"><div align="center"> <a href="cpzs_list.asp?id=<%=id(i)%>" target="_blank"> </a>
<table width="100" height="100" border="1" cellpadding="1" cellspacing="1" bordercolor="#666666">
<tr>
<td><a href="cpzs_list.asp?id=<%=id(i)%>" target="_blank"><img border="0" src="
<%
if trim(zhaopian(i))="" then
response.Write("images/none.jpg")
else
response.Write(trim(zhaopian(i)))
end if
%>
" width="100" height="100"></a></td>
</tr>
</table>
</div></td>
<td width="69%" HEIGHT="140" bgcolor="#EEEEEE" class="text">专家姓名:<%=xingming(i)%><br>
职称:<%=zhicheng(i)%><br>
联系地址:<%=dizhi(i)%><br>
专家简介:
<%
if len(jianjie(i))>1 then
response.Write(left(jianjie(i),15) & "......")
else
response.Write(trim(jianjie(i)))
end if
%>
<br>
<br>
</td>
<%a=a+1%>
<%if a>0 then %>
</tr>
<tr>
<%a=0%>
<%end if%>
<%next%>
</tr>
<tr align="center" valign="middle" bgcolor="#EFEFEF">
<td height="29" COLSPAN="6"><p align="center" class="text"> 共<%=totalpage%>页 第<%=page%>页

<%if page-1>0 then%>
<a href="cpzs.asp?page=<%=page-1%>">上一页</a>
<%else%>
上一页
<%end if%>
<%if page+1<=totalpage then%>
<a href="cpzs.asp?page=<%=page+1%>">下一页</a>
<%else%>
下一页
<%end if%>
<%
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
response.write " <input class=input type='submit' value=' Goto ' name='cndok'></span></p>"
%>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></TD>
<TD width="271">&nbsp;</TD>
<td width="128"></td>
</TR>
<tr>
<td height="331"></td>
<td></td>
<td></td>
</tr>
<TR>
<TD height="1" colspan="2"><IMG SRC="../../images/spacer.gif" WIDTH=79 HEIGHT=1 ALT=""></TD>
<td></td>
</TR>
</TABLE></td>
</tr>
</table>
<%
set rs=nothing
conn.close
set conn=nothing
%>
</p>

搜索更多相关主题的帖子: css head content include images 
2006-11-27 15:27
做人很低调
Rank: 5Rank: 5
等 级:贵宾
威 望:18
帖 子:1268
专家分:0
注 册:2006-8-2
收藏
得分:0 

你没有写<form>表单
怎么能实现你想要的提交表单跳转?


其实我很低调,只是你不知道...
2006-11-27 16:03
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
得分:0 
谢谢,我加上表单了,但效果实现不了....

再帮忙看看
代码如下:
<!--#include file="../inc/conn_other.asp"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<link href="../../css/1.css" rel="stylesheet" type="text/css">
<link href="../../css/2.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-image: url(../../images/bg1111.gif);
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
</head>
<body>
<p>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="212" height="550">&nbsp;</td>
<td width="780" align="center" valign="top"><TABLE WIDTH=780 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<!--DWLayoutTable-->
<TR>
<TD width="509" height="218" valign="top" background="../../images/left_bg.gif"><table width="509" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table> <table width="509" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="99%" height="205" border="0" cellpadding="0" cellspacing="1">
<%

set rs=server.createobject("adodb.recordset")

page=request.querystring("page")
if page="" then page=1
if not(isnumeric(page)) then page=1
if page<1 then page=1
page=int(page)

sql="select * from zhuanjia order by Product_Date DESC"
rs.open sql,conn,3,1
if rs.eof then
%>
<tr bgcolor="#EEEEEE">
<td height="24" colspan="2"><div align="center"><font color="#FF0000" size="3">暂时没有专家!!!</font></div></td>
</tr>
<%
response.end
else
rs.pagesize=5
totalrec=rs.recordcount
totalpage=rs.pagecount
if page>totalpage then page=totalpage
rs.absolutepage=page
i=0

dim id(),xingming(),zhaopian(),zhicheng(),jianjie(),dizhi()
do while not rs.eof and (i<rs.pagesize)
i=i+1
redim preserve id(i),xingming(i),zhaopian(i),zhicheng(i),jianjie(i),dizhi(i)
id(i)=rs("id")
xingming(i)=rs("xingming")
zhaopian(i)=rs("zhaopian")
zhicheng(i)=rs("zhicheng")
jianjie(i)=rs("jianjie")
dizhi(i)=rs("dizhi")
rs.movenext
loop
end if
rs.close
%>
<tr>
<%for i = 1 to ubound(id)%>
<td width="31%" HEIGHT="140" align="center" valign="middle" bgcolor="#EEEEEE"><div align="center"> <a href="cpzs_list.asp?id=<%=id(i)%>" target="_blank"> </a>
<table width="100" height="100" border="1" cellpadding="1" cellspacing="1" bordercolor="#666666">
<tr>
<td><a href="cpzs_list.asp?id=<%=id(i)%>" target="_blank"><img border="0" src="
<%
if trim(zhaopian(i))="" then
response.Write("images/none.jpg")
else
response.Write(trim(zhaopian(i)))
end if
%>
" width="100" height="100"></a></td>
</tr>
</table>
</div></td>
<td width="69%" HEIGHT="140" bgcolor="#EEEEEE" class="text">专家姓名:<%=xingming(i)%><br>
职称:<%=zhicheng(i)%><br>
联系地址:<%=dizhi(i)%><br>
专家简介:
<%
if len(jianjie(i))>1 then
response.Write(left(jianjie(i),15) & "......")
else
response.Write(trim(jianjie(i)))
end if
%>
<br>
<br>
</td>
<%a=a+1%>
<%if a>0 then %>
</tr>
<tr>
<%a=0%>
<%end if%>
<%next%>
</tr>
<tr align="center" valign="middle" bgcolor="#EFEFEF">

<td height="29" COLSPAN="6">
<form method=Post action="cpzs.asp?page=<%=page%>">
<p align="center" class="text"> 共<%=totalpage%>页 第<%=page%>页

<%if page-1>0 then%>
<a href="cpzs.asp?page=<%=page-1%>">上一页</a>
<%else%>
上一页
<%end if%>
<%if page+1<=totalpage then%>
<a href="cpzs.asp?page=<%=page+1%>">下一页</a>
<%else%>
下一页
<%end if%>

<%
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 value="&page&">"
response.write " <input type='submit' value=' Goto ' name='cndok'></span>"
%>
</p>
</form>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></TD>
<TD width="271">&nbsp;</TD>
<td width="128"></td>
</TR>
<tr>
<td height="331"></td>
<td></td>
<td></td>
</tr>
<TR>
<TD height="1" colspan="2"><IMG SRC="../../images/spacer.gif" WIDTH=79 HEIGHT=1 ALT=""></TD>
<td></td>
</TR>
</TABLE></td>
</tr>
</table>
<%
set rs=nothing
conn.close
set conn=nothing
%>
</p>


2006-11-28 09:21
做人很低调
Rank: 5Rank: 5
等 级:贵宾
威 望:18
帖 子:1268
专家分:0
注 册:2006-8-2
收藏
得分:0 

首先,用<form>表单提交的参数要用request.form("page")获取
还有就是 你 form提交传的参数<form method=Post action="cpzs.asp?page=<%=page%>">
这个page变量是当前的页号 并不是用户输入的要跳转的页号
你现在把开始你写的page=request.querystring("page")
改成page=request("page") 这样的方法是可以接收到两种不同方式的传值
在把form表单提交到本页就可以了
<form method=Post action="cpzs.asp">
但值得注意的是request("page")这种方法虽然可以接收到form提交和URL传参数
但是 尽量能不用就不用
因为request("page")这样没有写request后边的集合或属性的话
系统会一个一个的来找合适的集合或属性 直到找到了一个合适的为止 如: .form或.querystring
这样就影响了一定的速度...

[此贴子已经被作者于2006-11-28 10:54:03编辑过]


其实我很低调,只是你不知道...
2006-11-28 10:53
快速回复:跳转页问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.039330 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved