最近,我在dreamweaver的后台文件中引用了其他文件,无论引用文件放在head或body之间,前台的内容都不见了。当然,不引用就可以看到前台内容。但是,运行时又可以看到。请问,那位知道如何解决这个问题。先谢过了。

解决方案 »

  1.   

    看一下你引用的文件里是不是有<html>,<head>等标签, 如果有的话就会出现你那样的问题因为包含文件进来就相当于复制这部分代码进来,注意格式
      

  2.   

    标签问题啊,
    我 遇见过外部调用JavaScript时出现这种问题,我把<head><script src="" language="javascript" /></head>修改 成<head><script src="" language="javascript" ></script></head>就没有问题了!
      

  3.   

    我的文件肯定放站点里了,不然,怎么能正常运行呢.我个人认为可能是dreamweaver中有点小BUG吧.因为站点运行一切正常,就设计时前台文件显示不出来.只显示一个ASP标志.谢谢了
    不过,我自己也找到解决的办法,就是把include file去掉,再修改前台文件,修改好了再把include file 加上,这样也可以.不过,就是太麻烦了.代码如下:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
    <% option explicit %>
    <!-- #include file="config/db.asp" -->
    <!-- #include file="config/function.inc.asp" -->
    <!-- #include file="config/fy.asp" -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>本站公告</title>
    <style type="text/css">
    <!--
    body {
    font-size: 16px;
    }
    -->
    </style>
    </head><body>
    <%
    dim id
    if request.QueryString("id")="" then
      id=1
    else
      id=cint(request.QueryString("id"))
    end if
    %>
    <%
    '显示数据
    on error resume next
    dim rst1,sql1,show
    sql1="select a_title,a_content from tbl_affiche where a_id="&id
    set rst1=server.CreateObject("adodb.recordset")
    rst1.open sql1,conn,1,1
    if rst1.eof and rst1.bof then
      msgboxU "参数错误!"
    else
      show="true"
    end if
    %><p><a href="index.asp" target="_blank">首页</a>-本站公告</p>
    <table width="739" height="140" border="1" cellspacing="0" bordercolor="#CCCCCC">
      <tr>
        <td width="146" height="32"><div align="center">公告标题</div></td>
        <td width="589">
          <% if show="true" then %><%=rst1("a_title")%><% end if %>
        
        </td>
      </tr>
      <tr>
        <td height="32"><div align="center">公告内容</div></td>
        <td><% if show="true" then %><%=rst1("a_title")%><% end if %>
        
        </td>
      </tr>
      <%
    rst1.close
    set rst1=nothing
    %>
      <%
      '显示表格中的数据
      on error resume next
      dim rst,sql,pagelistnum,link,page
      pagelistnum=3
      link="showaffiche.asp?id="&id&""
      if request.QueryString("page")="" then
        page=1
      else
        page=cint(request.QueryString("page"))
      end if
      sql="select top "&(page*pagelistnum)&" * from tbl_affiche"
      set rst=server.CreateObject("adodb.recordset")
      rst.open sql,conn,1,1
      rst.PageSize=pagelistnum
      rst.AbsolutePage=page
      if rst.eof and rst.bof then
        msgboxU "错误参数!"
      else
        do while not rst.eof
     %>
      <tr>
        <td height="37" colspan="2"><div align="left"><% response.Write "<a href='showaffiche.asp?id="&rst("a_id")&"&page="&page&"' target='_self'>"&rst("a_id")&":"&cutstr(rst("a_title"),15,"...")&"</a>" %></div></td>
      </tr>
      <%
       rst.movenext
    loop
      end if
      rst.close
      set rst=nothing
      sql="select count(*) as recnum from tbl_affiche"
      %>
      <tr>
        <td height="35" colspan="2"><div align="center">
    <%
    fy sql,page,pagelistnum,link

    %>
    </div></td>
      </tr>
    </table>
    <p>&nbsp; </p>
    <%
    conn.close
    set conn=nothing
    %>
    </body>
    </html>