我是个ASP新手才学了几天,所以遇到很多问题请个位大虾多多帮忙了,希望以后能更好的学习。我在网上下了一个ASP在线购物的原代码,想试这照着做做,可出现了一些问题。下面是他的默认页原代码(default.asp)
<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<!--#include file="Ubb.asp"-->
<html>
<head>
<title><%=webname%>--首页</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="webtop.asp" -->
<div align="center">
<table width="777" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="180" height="0" valign="top">
<!--#include file="info_user.asp" -->
<!--#include file="info_class2.asp" -->
<!--#include file="sousuo.asp" -->
<!--#include file="info_brand.asp" -->
<!--#include file="info_vote.asp"--> </td>
<td width="1" valign="top" background="images/bj_x.gif"></td>
<td width="590" valign="top">
<table width="590" height="124" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="456"><table width="406" height="98" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="55" valign="top"><table width="100%" height="29" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="50%"><img src="images/yemian/4.gif"></td>
<td width="50%"><img src="images/yemian/451.gif"></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src="images/yemian/TOP.gif" width="406" height="44"></td>
</tr>
</table>
<table width="407" height="101" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="407" height="68"><table width="100%" height="100" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<%set rs=server.CreateObject("adodb.recordset")
rs.open "select top 4 * from sh_chanpin where bestbook=1 order by adddate desc ",conn,1,1
if rs.recordcount=0 then
response.write "<td align=center><font color=red size=2>对不起,暂无新品!</font></td>"
'response.End
else
%>
<%
if not rs.eof then
i=1
do while not rs.eof%>
<td width="240" height="100" align="center" valign="top"><table width="96" height="99" border="0"lign="center" cellPadding=2 cellSpacing=1 bgColor=#CCCCCC>
<tr>
<td width="88" height="73" bgColor=#ffffff align=center >
<div align="center">
<%if rs("bookpic")="" then
response.write "<div align=center><a href=list.asp?id="&rs("bookid")&"><img src=images/emptybook.gif width=75 height=75 border=0></a></div>"
else
%>
<a href=list.asp?id=<%=rs("bookid")%>><img src="<%=trim(rs("bookpic"))%>" width=75 border=0 height="75" alt="<%=trim(rs("bookname"))%>"></a>
<%end if%>
</div></td>
</tr>
<tr>
<td height="43%" background="images/yemian/lg_b.gif"><div align="center"><a href=list.asp?id=<%=rs("bookid")%>><font color="#FF0000">
<%if len(trim(rs("bookname")))>5 then
response.write left(trim(rs("bookname")),5)&""
else
response.write trim(rs("bookname"))
end if
%></font>
</a></div></td>
</tr>
</table></td>
<%if i mod 8 = 0 then%>
</tr>
<%end if
rs.movenext
i=i+1
loop
rs.close
end if
end if
%>
</table>
</td>
</tr>
</table></td>
<td width="134"><table width="182" height="202" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td valign="bottom" background="images/yemian/new.gif">
<table width="174" height="172" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="172" align="center" valign="top"><!--#include file="info_newshou.asp" --></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<td height="158"><!--#include file="info_newly.asp" -->
</td>
</table>
<table width="100%" height="162" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="588" height="3" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="images/main/th_bg.gif"></td>
</tr>
</table>
<!--#include file="info_wyou.asp" --> </td>
</tr>
</table>
<table width="100%" height="176" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="176"><!--#include file="info_prime.asp"--></td>
</tr>
</table></td>
</tr>
</table>
</div>
<!--#include file="webfoot.asp"-->
上面的红色代码是什么意思呀?我个人认为好象是将分页加入到本页中的意思不知道对不对?
我模仿他的做法也做了几个分页,但预览时出现了错误!(我只加了两个)
下面是我的默认页代码:(default.asp)
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table width="748" height="356" border="0" align="center" cellpadding="0">
<tr>
<th height="352" valign="top" scope="col"><table width="743" height="66" border="0" cellpadding="0">
<tr>
<td nowrap scope="col"><div align="center"><!--#include file="webtop.asp"--></div></td>
</tr>
</table>
<div align="left">
<table width="149" height="166" border="0" cellpadding="0">
<tr>
<th valign="top" scope="col"><div align="center">
<table width="186" height="79" border="0" cellpadding="0">
<tr>
<th scope="col"><div align="center"><!--#include file="info_user.asp"--></div></th>
</tr>
<tr>
<td> </td>
</tr>
</table>
</div></th>
</tr>
</table>
<br>
</div></th>
</tr>
</table>
</body>
</html>
预览的时候出现了错误:
Active Server Pages, ASP 0141 (0x80004005)
@ 命令只能在 Active Server Page 中使用一次。
/myweb/s_j_eshop/info_user_main.asp, 第 1 行
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; (R1 1.5))
"@ 命令只能在 Active Server Page 中使用一次。"是什么错误呀?我将第一行的去掉也不行呀
请大家帮忙看一下了!