Knight94(愚翁)说的Custom ComboBoxes with Advanced Drop-down Features控件 和sdl2005lyx()说的DotNetMagic只能在winform中使用,我现在想在webform中使用, 我的js不是很好所以想用控件的方式实现,不知道大家有什么好的控件推荐吗? 先谢谢大家了
自己算出某一项的层级,然后画线。root │ │ ├----node1 ├----node2 └
<% Session("FoldLev")=request("Lev") If Session("FoldLev")="" or not(IsNumeric(Session("FoldLev"))) or Session("FoldLev")>10 or Session("FoldLev")<1 Then Session("FoldLev")=3 End if If request("Path")="" then Path="/Userservice/Download/Content" Else Path=request("Path") End if response.write "<Select Name=""FoldList"" Size=""1""><Option>"&Mid(Path,InstrRev(replace(Path,"\","/"),"/",Len(Path)-1)+1)&"</Option>" Dim a(11) '调用子程序,a表示它是否为第a级目录的最后一个子目录 Call FoldListSub(Path,Session("FoldLev")) response.write "</Select>"function FoldListSub (Path,Lev) Set Fold=Server.CreateObject("Scripting.FileSystemObject") Set FoldList=Fold.GetFolder(Server.MapPath(Path)) If FoldList.SubFolders.count>0 Then j=1 For each i in FoldList.SubFolders Flag=Len(Server.MapPath(Path&"\"&i.name)) '判断当前应该截取第几级目录 For k=1 to Session("FoldLev")-Lev+1 Flag=InstrRev(replace(Server.MapPath(Path&"\"&i.name),"\","/"),"/",Flag-1) Next If j=FoldList.SubFolders.count Then a(Lev)=1 nbsp="" '产生格式 For k=1 to (Session("FoldLev")-Lev)*2 If (k=1 or k/2<>k\2) and a(Session("FoldLev")-(k-1)/2)<>1 Then nbsp=nbsp&"│" Else nbsp=nbsp&" " End if Next response.write "<Option Value="""&Mid(Server.MapPath(Path&"\"&i.name),Flag+1)&""">" &"└"&i.name&"</Option>" '判断它是哪级目录的最后一个子目录,用于确定制表符的格式 Else a(Lev)=0 nbsp="" '产生格式 For k=1 to (Session("FoldLev")-Lev)*2 If (k=1 or k/2<>k\2) and a(Session("FoldLev")-(k-1)/2)<>1 Then nbsp=nbsp&"│" Else nbsp=nbsp&" " End if Next response.write "<Option Value="""&Mid(Server.MapPath(Path&"\"&i.name),Flag+1)&""">" &"├"&i.name&"</Option>" End if If Lev>1 Then Call FoldListSub(Path&"\"&i.name,Lev-1) End if j=j+1 Next End if End function %>用VB脚本写的
http://www.codeproject.com/cs/miscctrl/customcombos.asp
和sdl2005lyx()说的DotNetMagic只能在winform中使用,我现在想在webform中使用,
我的js不是很好所以想用控件的方式实现,不知道大家有什么好的控件推荐吗?
先谢谢大家了
│
│
├----node1
├----node2
└
Session("FoldLev")=request("Lev")
If Session("FoldLev")="" or not(IsNumeric(Session("FoldLev"))) or Session("FoldLev")>10 or Session("FoldLev")<1 Then
Session("FoldLev")=3
End if
If request("Path")="" then
Path="/Userservice/Download/Content"
Else
Path=request("Path")
End if
response.write "<Select Name=""FoldList"" Size=""1""><Option>"&Mid(Path,InstrRev(replace(Path,"\","/"),"/",Len(Path)-1)+1)&"</Option>"
Dim a(11)
'调用子程序,a表示它是否为第a级目录的最后一个子目录
Call FoldListSub(Path,Session("FoldLev"))
response.write "</Select>"function FoldListSub (Path,Lev)
Set Fold=Server.CreateObject("Scripting.FileSystemObject")
Set FoldList=Fold.GetFolder(Server.MapPath(Path))
If FoldList.SubFolders.count>0 Then
j=1
For each i in FoldList.SubFolders
Flag=Len(Server.MapPath(Path&"\"&i.name))
'判断当前应该截取第几级目录
For k=1 to Session("FoldLev")-Lev+1
Flag=InstrRev(replace(Server.MapPath(Path&"\"&i.name),"\","/"),"/",Flag-1)
Next
If j=FoldList.SubFolders.count Then
a(Lev)=1
nbsp=""
'产生格式
For k=1 to (Session("FoldLev")-Lev)*2
If (k=1 or k/2<>k\2) and a(Session("FoldLev")-(k-1)/2)<>1 Then
nbsp=nbsp&"│"
Else
nbsp=nbsp&" "
End if
Next
response.write "<Option Value="""&Mid(Server.MapPath(Path&"\"&i.name),Flag+1)&""">" &"└"&i.name&"</Option>"
'判断它是哪级目录的最后一个子目录,用于确定制表符的格式
Else
a(Lev)=0
nbsp=""
'产生格式
For k=1 to (Session("FoldLev")-Lev)*2
If (k=1 or k/2<>k\2) and a(Session("FoldLev")-(k-1)/2)<>1 Then
nbsp=nbsp&"│"
Else
nbsp=nbsp&" "
End if
Next
response.write "<Option Value="""&Mid(Server.MapPath(Path&"\"&i.name),Flag+1)&""">" &"├"&i.name&"</Option>"
End if
If Lev>1 Then
Call FoldListSub(Path&"\"&i.name,Lev-1)
End if
j=j+1
Next
End if
End function
%>用VB脚本写的