<%
response.write("<!--#include file="belly.asp"-->")
%>
这么写不灵
目的是经过asp代码判断后决定引入哪个页面
求各位路过不要错过帮忙搞一下

解决方案 »

  1.   

    ...这是Asp。net  。。LZ你帖子放错地方了。。
    <%
    response.write("<!--#include file=\"belly.asp\"-->")
    %>
     
    没有转义吧
      

  2.   

    这种形式叫:动态调用include 文件。
    函数:
    Function include(filename)
        Dim re, content, fso, f, aspStart, aspEnd    Set fso = CreateObject("s cripting.FileSystemObject")
        Set f = fso.OpenTextFile(server.mappath(filename))
        content = f.ReadAll
        f.Close
        Set f = Nothing
        Set fso = Nothing    Set re = New RegExp
        re.Pattern = "^\s*="
        aspEnd = 1
        aspStart = InStr(aspEnd, content, "<%") + 2
        Do While aspStart>aspEnd + 1
            Response.Write Mid(content, aspEnd, aspStart - aspEnd -2)
            aspEnd = InStr(aspStart, content, "%\>") + 2
            Execute(re.Replace(Mid(content, aspStart, aspEnd - aspStart -2), "Response.Write "))
            aspStart = InStr(aspEnd, content, "<%") + 2
        Loop
        Response.Write Mid(content, aspEnd)
        Set re = Nothing
    End Function调用方法:
    include("belly.asp")
      

  3.   

    response.write是输入到前端源页面。去掉response.write
      

  4.   

    你的都是两个字符串了response.write("<!--#include file=""belly.asp""-->")
    如果不行的话就再把<>符号,换成VB的Ascll码。网上查下,我就不帮你查了