"小灰"的专栏

---留下自己的每个足迹,与朋友分享,与后来者参考......

ASP中生成静态页面技术

演示:http://asp2004.net/temp/treemenu/menu.asp
源代码下载:http://asp2004.net/temp/treemenu.rar

None.gif<!--#include file="conn.asp"-->
None.gif
<%
None.gif
Dim Str
None.gif
None.gif
Function menu(id)
None.gif   
Set rs = server.CreateObject("adodb.recordset")
None.gif    sql
= "select * from menu where id1="&id&" order by url,id"
None.gif
    rs.Open sql, conn, 1, 1
None.gif    Str
= Str + "<table border='0' cellspacing='0' cellpadding='0'>" + Chr(13)
None.gif    i
= 1
None.gif   
While Not rs.EOF
None.gif        ChildCount
= conn.Execute("select count(*) from menu where id1="&rs("id"))(0)
None.gif       
If ChildCount = 0 Then
None.gif           
If i = rs.recordcount Then
None.gif                menutype
= "file1"
None.gif
            Else
None.gif                menutype
= "file"
None.gif
            End If
None.gif            menuname
= "<a href='"&rs("url")&"' target='_blank'>"&rs("menuname")&"</a>"
None.gif
            onmouseup = ""
None.gif
        Else
None.gif           
If i = rs.recordcount Then
None.gif                menutype
= "menu3"
None.gif
                listtype = "list1"
None.gif
                onmouseup = " onMouseUp=change1('a"&rs("id")&"','b"&rs("id")&"');"
None.gif
            Else
None.gif                menutype
= "menu1"
None.gif
                listtype = "list"
None.gif
                onmouseup = " onMouseUp=change2('a"&rs("id")&"','b"&rs("id")&"');"
None.gif
            End If
None.gif            menuname
= rs("menuname")
None.gif       
End If
None.gif        Str
= Str + "<tr><td id='b"&rs("id")&"' class='"&menutype&"'"&onmouseup&">"&menuname&"</td></tr>" + Chr(13)
None.gif       
If ChildCount>0 Then
None.gif            Str
= Str + "<tr id='a"&rs("id")&"' style='display:none'><td class='"&listtype&"'>" + Chr(13)
None.gif            menu(rs(
"id"))
None.gif            Str
= Str + "</td></tr>" + Chr(13)
None.gif       
End If
None.gif        rs.movenext
None.gif        i
= i + 1
None.gif   
Wend
None.gif    Str
= Str + "</table>" + Chr(13)
None.gif    rs.Close
None.gif   
Set rs = Nothing
None.gif
End Function
None.gif
None.gifmenu(
0)
None.gif
None.gif
Set fso = server.CreateObject("scripting.filesystemobject")
None.gif
Set f1 = fso.OpenTextFile(server.MapPath("demo.htm"), 2, true)
None.giff1.Write(
"<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>")
None.giff1.Write(
"<html>")
None.giff1.Write(
"<head>")
None.giff1.Write(
"<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>")
None.giff1.Write(
"<title>哈哈~~~!这回速度超快了吧?</title>")
None.giff1.Write(
"<meta name='keywords' content='asp2004,树,菜单,无限级'>")
None.giff1.Write(
"<meta name='author' content='小灰,quxiaohui_0@163.com'>")
None.giff1.Write(
"<link href='style.css' rel='stylesheet' type='text/css'>")
None.giff1.Write(
"<script language='javascript' src='function.js'></script>")
None.giff1.Write(
"</head>")
None.giff1.Write(
"<body>")
None.giff1.Write(
"<a href='http://asp2004.net' target='_blank'>http://asp2004.net</a>提供最新下载《<a href='menu.asp'>管理</a>》<br>")
None.gif
None.giff1.Write(Str)
None.gif
None.giff1.Write(
"</body>")
None.giff1.Write(
"</html>")
None.giff1.Close
None.gif
Set fso = Nothing
None.gif
None.gifresponse.Redirect(
"demo.htm")
None.gif%
>
阅读更多
个人分类: ASP
想对作者说点什么? 我来说一句

静态页面技术

2011年10月12日 17.3MB 下载

asp生成html,asp生成静态

2010年12月01日 628KB 下载

生成静态页面技术解决方案

2008年11月13日 33KB 下载

没有更多推荐了,返回首页

不良信息举报

ASP中生成静态页面技术

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭