网学网为广大网友收集整理了,ajax+asp无限级分类树型结构的代码,希望对大家有所帮助!
复制代码 代码如下:
<%
''数据库字段为类属性,添加、删除、修改、操作检查等函数为类的方法
Class Cls_Leibie
Private nClassID,sClassName,nParentID,sParentPath,nDepth,nRootID,nChild,nOrderID,sFilePath ''定义私有变量(类的属性,即数据库字段对应的变量)
Private rs,sql,ErrorStr
Private Sub Class_Initialize()
ErrorStr="" ''初始化错误信息为空
End Sub
Private Sub Class_Terminate() ''销毁类时关闭数据库连接
If IsObject(Conn) Then
Conn.Close
Set Conn = Nothing
End If
End Sub
''*******************设置各个属性******************************************************
Public Property Let ClassID(str) ''获取类别ID(主键)
nClassID=str
call ClassProperty() ''获取类别ID时调用此函数读出类的所有属性
End Property
Public Property Let ClassName(str) ''获取类别名称
sClassName=str
End Property
Public Property Get ClassName
ClassName=sClassName
End Property
Public Property Let ParentID(str) ''获取类别父ID
nParentID=str
End Property
Public Property Get ParentID
ParentID=nParentID
End Property
Public Property Let ParentPath(str) ''获取父路径ID
sParentPath=str
End Property
Public Property Get ParentPath
ParentPath=sParentPath
End Property
Public Property Let Depth(str) ''获取类别深度
&nb