标题:新手求助!预览不了呀!
只看楼主
sj1762
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2006-2-14
 问题点数:0 回复次数:2 
新手求助!预览不了呀!

我是个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" -->&nbsp;</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>&nbsp;</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 中使用一次。"是什么错误呀?我将第一行的去掉也不行呀
    请大家帮忙看一下了!
  • 搜索更多相关主题的帖子: 预览 
    2006-02-15 15:56
    sj1762
    Rank: 1
    等 级:新手上路
    帖 子:15
    专家分:0
    注 册:2006-2-14
    得分:0 

    晕呀,为什么我一发就是乱吗呀?谁能告诉我啊????

    2006-02-15 15:58
    sj1762
    Rank: 1
    等 级:新手上路
    帖 子:15
    专家分:0
    注 册:2006-2-14
    得分:0 
       不好意思了,由于第一次发贴没有弄明白,大家点下面的"运行代码"看一下把,我想问题应该很简单把.先谢谢各位了!
    2006-02-15 16:03



    参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-45649-1-1.html




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

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