父分类和子分类问题
怎么实现只有现点击父分类子分类才会显示出来,
下面的程序 把父分类和子分类都显示出来了。
Function ClassList(ChannelID)
dim sql,rs,i,Q
Dim ClassID
ClassID=Trim(Request.QueryString( "ClassID "))
IF isnumeric(ClassID) <> True or ClassID= " " Then
ClassID=0
End IF
Sql= "select * from [Weed_Class] where ChannelID= "&CInt(ChannelID)& " order by ClassList "
Set rs=Execute(SQL)
If Not(rs.eof And rs.bof) Then
Do While Not(rs.eof)
Tmp=Tmp& " <div style= 'padding:2px 10px; '> "
If Rs( "ClassID ")=0 Then
If ClassID=Rs( "ID ") Then
IsMe= "style= 'color:#f00 ' "
Else
IsMe= " "
End If
Tmp=Tmp& " <img src= 'img/+.gif ' /> <a href= '?ClassID= "&Rs( "ID ")& " ' "&IsMe& "> "&Rs( "ClassName ")& " </a> "
Else
For I=1 To Rs( "ClassDeep ")
Tmp=Tmp& " "
Next
If Int(Request.QueryString( "ClassID "))=Rs( "ID ") Then
IsMe= "style= 'color:#f00 ' "
Else
IsMe= " "
End If
Tmp=Tmp& " <img src= 'img/+-.gif ' /> <img src= 'img/-.gif ' align= 'absmiddle '> <a href= '?ClassID= "&Rs( "ID ")& " ' "&IsMe& "> "&Rs( "ClassName ")& " </a> "
End If
Tmp=Tmp& " </div> "
rs.movenext
Loop
End if
Set rs=Nothing
ClassList=Tmp
End Function
------解决方案--------------------具体要客户端javascript+服务器端脚本实现
请查阅Ajax技术
------解决方案--------------------http://blog.csdn.net/abigfrog/archive/2007/10/16/1827036.aspx