框架页问题
这个框架页包括三个文件,jhd.asp top.asp down.asp down.asp 查找信息传值到top.asp 进行处理,奇怪的是 top.asp不能加 if ...then ....end if 语句,一加就出错.
还有,这个框架页 kaidan.asp 处于另一个框架中
有谁碰过这个问题??以下的代码是没有错误的,但top.asp加 if ...then ....end if 语句则出错.
------------------------------------------------------------- kaidan.asp框架
<!-- #include file="yanzheng.asp" -->
<html>
<head>
<title>新建网页 1</title>
</head>
<frameset border="false" frameBorder="0" frameSpacing="0" rows="15%,*,10%">
<frame name="ri1" scrolling="no" src="jhd.asp">
<frame name="ri" src="top.asp">
<frame name="footnotes" scrolling="no" src="down.asp" target="ri" >
<noframes>
<body>
<p>此网页使用了框架,但您的浏览器不支持框架。</p>
</body>
</noframes>
</frameset>
</html>
-----------------------------------------------------------jhd.asp
<!-- #include file="yanzheng.asp" -->
<!-- #include file="conn.asp" -->
<!-- #include file="fanzhu.asp" -->
<% dim sql,sql1,sql2,rst,rst1
set rst1=server.createobject("adodb.recordset")
set rst=server.createobject("adodb.recordset")
set rs=server.createobject("adodb.recordset")
rs.open "SELECT GETDATE() as xj" ,conn,1,1
sql ="select * from cp_货商表"
sql1="select * from cp_仓库设置"
rst.open sql,conn,1,1
rst1.open sql1,conn,1,1
%>
<html>
<head>
<title>进货单</title><link href="yanshi.css" rel="stylesheet" type="text/css" >
</head>
<body>
<p align="center"><font size="5">进货单</font></p>
<form method="POST" action="jhd.asp">
<p align="left">货商 <select size="1" name="D1">
<% do while not rst.eof %>
<option><%=rst("cp_hsb_公司")%></option>
<%
rst.movenext
loop %>
</select> 仓库 <select size="1" name="D2"><%do while not rst1.eof %>
<option><%=rst1("cp_cksz_名称")%></option>
<%
rst1.movenext
loop
xj=rs("xj")
randomize
dh=cstr(int(rnd()*1000)+1)
xjdh=cstr(xj&"-"&dh)
xjdh=mid(replace(replace(replace(xjdh,"-","")," ",""),":",""),3)
%>
</select> 进货时间 <input type="text" name="T1" size="10" value ="<%=date()%>"> 单号
<input type="text" name="T2" size="14" value ="<%=xjdh%>">
<input type="submit" value="保存" name="B2"></p>
</form>
</body>
</html>
<%
rst.close
rst1.close
%>
---------------------------------------------------------------------top.asp
<!-- #include file="yanzheng.asp" -->
<!-- #include file="conn.asp" -->
<% dim sql,sql1,sql2,rst,rst1
set rst1=server.createobject("adodb.recordset")
set rst=server.createobject("adodb.recordset")
searchname=request.form("hw")
sql="select top 20 * from cp_货物信息 where cp_hwxx_编号 like '%" &searchname &"%'"
rst.open sql,conn,1,1
%>
<html>
<head>
<title>新建网页 1</title><link href="yanshi.css" rel="stylesheet" type="text/css" >
</head>
<body>
</p>
<table border="0" >
<%do while not rst.eof%>
<tr>
<td width="120"><%=replace(rst("cp_hwxx_编号"),searchname,"<font color=#000000>" & searchname & "</font>")%> </font> </td>
<td width="180"><%=rst("cp_hwxx_品名")%></td>
<td width="20"><%=rst("cp_hwxx_单位")%></td>
<td width="50"> <%=rst("cp_hwxx_品名")%></td>
<td> <%=rst("cp_hwxx_品名")%></td>
</tr>
<% rst.movenext
loop%>
</table>
</body>
</html>
<%
rst.close%>
-----------------------------------------------------------------dowm.asp
<html>
<head>
<title>fdsfds</title><link href="yanshi.css" rel="stylesheet" type="text/css" >
<base target="ri">
</head>
<body><p></p>
<p></p>
<p></p>
<p></p>
<form method="post" action="top.asp?act=zhaohw">
<p><input type="text" name="hw" size="20"><input type="submit" value="查找货物" name="zhaohw"><input type="reset" value="重置" name="B2"></p>
</form>
</body>
</html>