当前位置:编程学习 > C#/ASP.NET >>

怎样实现树型的下拉列表

需要在b/s模式中实现树型下拉列表,希望各位提些建议,或者提供一个满足这个功能的控件,谢谢。 --------------------编程问答-------------------- 关注,顶 --------------------编程问答-------------------- TreeView 控件撒。 --------------------编程问答-------------------- 我需要的是点击下拉列表的箭头后不是显示列表而是显示一个TreeView --------------------编程问答-------------------- http://www.sucai86.com/texiaofile/266.htm --------------------编程问答-------------------- mark --------------------编程问答-------------------- Custom ComboBoxes with Advanced Drop-down Features
http://www.codeproject.com/cs/miscctrl/customcombos.asp --------------------编程问答-------------------- DotNetMagic听说过吗,属于第三方的net控件扩展库,非常好用,其中TreeControl就可以轻松实现你的要求 --------------------编程问答-------------------- 关注 --------------------编程问答-------------------- 网页上实现这种效果,应该用JS来实现吧。 --------------------编程问答-------------------- 帮顶 --------------------编程问答-------------------- 可以做组合控件
--------------------编程问答-------------------- Knight94(愚翁)说的Custom ComboBoxes with Advanced Drop-down Features控件
 和sdl2005lyx()说的DotNetMagic只能在winform中使用,我现在想在webform中使用,
 我的js不是很好所以想用控件的方式实现,不知道大家有什么好的控件推荐吗?
 先谢谢大家了 --------------------编程问答-------------------- 接点分 --------------------编程问答-------------------- 谢谢大家帮忙想想 --------------------编程问答-------------------- 大家帮忙想想啊 --------------------编程问答-------------------- 帮个忙啊 --------------------编程问答-------------------- 帮个忙 --------------------编程问答-------------------- 有没有知道的呀? --------------------编程问答-------------------- up --------------------编程问答-------------------- 自己算出某一项的层级,然后画线。。。。

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脚本写的
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,