一个参出传递问题!

PPLUNCLE 2003-08-25 12:45:28
我做的一个页面。
我就假设这里有以下三个页面"conn.asp","a.asp","b.asp"
其中b.asp为主页面,我的数据表名是从上个页面得到的,也就是a.asp中
用--tablename=request("tablename")
我在b.asp中想打开这个数据表,并显示其中的内容,同时我也做了个分页显示,
可以打开,也可以显示其中内容,但是到了分页显示就不行了
在第一个页面还可以显示,但是只要点击“下一页”就是个空白页面。
我觉得是那个表名没有传递过来,但是我又不知道怎么搞,用了Session变量还是不行.
大家帮帮我啊

---俺穷,没得分了
----只有可怜得10分咯
-----我全部拿出来啦
...全文
81 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
PPLUNCLE 2003-08-25
  • 打赏
  • 举报
回复
我的意思是说,我点击下一页就没有任何显示了
laibagefei 2003-08-25
  • 打赏
  • 举报
回复
b.asp中加hidden,将变量传递到a.asp中
Ianlan 2003-08-25
  • 打赏
  • 举报
回复
tname=session("tname")
全都换成
tname=<%=session("tname")%>
PPLUNCLE 2003-08-25
  • 打赏
  • 举报
回复
--b.asp--

<!--#include file="conn.asp"-->
<%
dim tnamex
tname=request("tname")
session("tname")=tname
if request("tname")="" then
response.end
end if
if tname="zb_zdqaqsszb" then
tnamex="电气安全设施总表"
end if
if tname="zb_zjzxhsszb" then
tnamex="建筑消防设施情况总表"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
<link href="../css.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
//-->
</script>
<title><%=tnamex%></title>
</head>
<body>
<div align="center"><font color="#FF0000"><%=tnamex%></font></div><br>
<table border="1" width="750" class="css" bgcolor="#eeeeee" align="center" cellpadding=5 cellspacing=0 bordercolor="#ffffff" bordercolordark="#eeeeee" bordercolorlight="#000000">
<%
set rs=server.CreateObject("ADODB.Recordset")
sql="select * from "&session("tname")
rs.open sql,conn,3,3,adcmdtext
rs.pagesize=4
tcount=rs.recordcount
tpage=rs.pagecount
page=request.QueryString("page")
if page="" then page=1
page=cint(page)
%>
<tr bgcolor="#eeeeee" align="center">
<td width="19" align="center"><font color="#FF0000">编 号</font></td>
<td width="19" align="center"><font color="#FF0000">合 同</font></td>
<td width="18" align="center"><font color="#FF0000">地 区</font></td>
<td width="142" align="center"><font color="#FF0000">工程名称</font></td>
<td width="128" align="center"><font color="#FF0000">委检单位</font></td>
<td width="76" align="center"><font color="#FF0000">检测日期</font></td>
<td width="57" align="center"><font color="#FF0000">检测结论</font></td>
<td width="89" align="center"><font color="#FF0000">报告发送日期</font></td>
<td width="92" align="center"><font color="#FF0000">备注</font></td>
</tr>
<%
tname=session("tname")
rs.move(page-1)*rs.pagesize '定位记录
for i=0 to rs.pagesize
%>
<tr bgcolor="#eeeeee" align="center">
<td align="center"><font color="#000000"><%=rs("bh")%></font></td>
<td align="center"><font color="#000000"><%=rs("ht")%></font></td>
<td align="center"><font color="#000000"><%=rs("dq")%></font></td>
<td align="center"><font color="#000000"><%=rs("gcmc")%></font></td>
<td align="center"><font color="#000000"><%=rs("wjdw")%></font></td>
<td align="center"><font color="#000000"><%=rs("jcrq")%></font></td>
<td align="center"><a href="javascript:MM_openBrWindow('jcjl.asp?jcjl=<%=rs("jcjl")%>&tname=zb_zdqaqsszb','','width=400,height=400')"><font color="#000000">请点击</font></a></td>
<td align="center"><font color="#000000"><%=rs("bgfsrq")%></font></td>
<td align="center"><font color="#000000"><%=rs("bz")%></font></td>

</tr>
<%
rs.movenext
if rs.eof then exit for
next
%>
<form action="zb.asp" method="post" name="form">
<tr bgcolor="#eeeeee">
<td colspan="9" align="right"> <font color="#000000">总共</font><font color="red"><%=totalcount%></font><font color="#000000">记录  当前为</font>:<font color="#FF0000"><%=page%></font><font color="#CC0000">/</font><font color="#FF0000"><%=rs.pagecount%></font> <font color="#CC0000">|</font> 
<%
tname=session("tname")
if page<>1 then
%>
<a href="zb.asp?page=1&tname=session("tname")">第一页</a><font color="#FF0000"> |</font> 
<a href="zb.asp?page=<%=(page-1)%>&tname=session("tname")">上一页</a>
<%end if%>
<font color="#FF0000"> |</font> 
<%
if page<>rs.pagecount then
%>
<a href="zb.asp?page=<%=(page+1)%>&tname=session("tname")">下一页</a> <font color="#CC0000">|</font> 
<a href="zb.asp?page=<%=tpage%>&tname=session("tname")">最末页</a>
<%end if%>
</td>
</tr>
</form>
</table>
</body>
</html>
wolf004 2003-08-25
  • 打赏
  • 举报
回复
b.asp的代码拿出来看看!

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧