日期:2014-05-19  浏览次数:20552 次

求一个xml生成有二级菜单例子
通过js或是asp.net读取xml,显示出菜单的样子,要有二级菜单。最好有css或是xslt样式控制。

------解决方案--------------------
又找到一个

http://www.51aspx.com/CV/AjaxNodeTree
------解决方案--------------------
帮顶
------解决方案--------------------
<%@ Page Language= "C# " MasterPageFile= "~/MasterPage.master " AutoEventWireup= "true " CodeFile= "Menu.aspx.cs " Inherits= "Menu " Title= "Untitled Page " %>
<asp:Content ID= "Content1 " ContentPlaceHolderID= "HeadPlaceHolder1 " Runat= "Server ">
<style type= "text/css ">
body { padding:0px;background: #E2ECF5;margin: 0px;}
body,div,span,p { font-size: 14px }
a { font-size: 12px }
a:link,a:visited {color: #666666; text-decoration: none }
a:hover {color: #666666; text-decoration: none }

#PnMenu {
margin-top:10px
}
#MenuList {
margin: auto;
list-style-type: none;
width:166px;
}
.citem{
border: #FFFFFF 1px outset;
padding: 1px;
margin-top: 4px;
background: #FFFFFF;
}
.citem p {
padding: 3px;
font-weight: bold;
background:#FAFAFA url(images/TitleBg.gif) no-repeat left;
border-bottom:#B7D0E6 2px solid;
margin: 0px;
color: #0B67A9;
text-indent: 5px;
cursor:pointer;
}
.citem p span {
padding-left:10px;
}
.SubLinks {
margin: 0px;
padding: 0px;
list-style-type: none;
background:#F1F5FA;
padding-top:5px;
padding-bottom:5px;
}
.SubLinks li {
list-style-type: none;
height:20px;
}
.SubLinks li a {
display: block;
text-indent: 15px;
margin:2px;
width:120px;
margin-left:10px;
height:22px;
line-height:22px;
}
.SubLinks li a:link,.SubLinks li a:visited {

}
.SubLinks li a:hover {
background: #FFFFFF url(images/LinksBg.gif) no-repeat;
color: #333333;

}

#PnUserInfo{
background:url(images/UserInfo.gif) no-repeat center;
text-indent: 30px;
width:166px;
height:36px;
line-height:36px;
margin:3px;
font-size:12px;
font-family:verdana;
}
</style>
<script language= "javascript ">
function expendMenu(id){
var o = document.getElementById( "SubLink_ "+id);
if(o.style.display== "block "||o.style.display== " "){
o.style.display= "none ";
}else{
o.style.display= "block ";
}
}
</script>
</asp:Content>
<asp:Content ID= "Content2 " ContentPlaceHolderID= "ContentPlaceHolder1 " Runat= "Server ">
<asp:Panel ID= "PnUserInfo " runat= "server ">
</asp:Panel>
<asp:Panel ID= "PnMenu " runat= "server "> </asp:Panel>
</asp:Content>