欢迎光临
我们一直在努力

ASP中生成静态页面技术-ASP教程,ASP技巧

建站超值云服务器,限时71元/月

<!–#include file="conn.asp"–>

<%

dim str

function menu(id)

set rs=server.createobject("adodb.recordset")

sql="select * from menu where id1="&id&" order by url,id"

rs.open sql,conn,1,1

str=str+"<table border=0 cellspacing=0 cellpadding=0>"+chr(13)

i=1

while not rs.eof

childcount=conn.execute("select count(*) from menu where id1="&rs("id"))(0)

if childcount=0 then

if i=rs.recordcount then

menutype="file1"

else

menutype="file"

end if

menuname="<a href="&rs("url")&" target=_blank>"&rs("menuname")&"</a>"

onmouseup=""

else

if i=rs.recordcount then

menutype="menu3"

listtype="list1"

onmouseup=" onmouseup=change1(a"&rs("id")&",b"&rs("id")&");"

else

menutype="menu1"

listtype="list"

onmouseup=" onmouseup=change2(a"&rs("id")&",b"&rs("id")&");"

end if

menuname=rs("menuname")

end if

str=str+"<tr><td id=b"&rs("id")&" class="&menutype&""&onmouseup&">"&menuname&"</td></tr>"+chr(13)

if childcount>0 then

str=str+"<tr id=a"&rs("id")&" style=display:none><td class="&listtype&">"+chr(13)

menu(rs("id"))

str=str+"</td></tr>"+chr(13)

end if

rs.movenext

i=i+1

wend

str=str+"</table>"+chr(13)

rs.close

set rs=nothing

end function

menu(0)

set fso=server.createobject("scripting.filesystemobject")

set f1=fso.opentextfile(server.mappath("demo.htm"),2,true)

f1.write("<!doctype html public -//w3c//dtd html 4.01 transitional//en http://www.w3.org/tr/html4/loose.dtd>")

f1.write("<html>")

f1.write("<head>")

f1.write("<meta http-equiv=content-type content=text/html; charset=gb2312>")

f1.write("<title>哈哈~~~!这回速度超快了吧?</title>")

f1.write("<meta name=keywords content=asp2004,树,菜单,无限级>")

f1.write("<meta name=author content=小灰,quxiaohui_0@163.com>")

f1.write("<link href=style.css rel=stylesheet type=text/css>")

f1.write("<script language=javascript src=function.js></script>")

f1.write("</head>")

f1.write("<body>")

f1.write("<a href=http://asp2004.net target=_blank>http://asp2004.net</a>提供最新下载《<a href=menu.asp>管理</a>》<br>")

f1.write(str)

f1.write("</body>")

f1.write("</html>")

f1.close

set fso=nothing

response.redirect("demo.htm")

%>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » ASP中生成静态页面技术-ASP教程,ASP技巧
分享到: 更多 (0)

相关推荐

  • 暂无文章