ASP.NET 2.0,写无限级下拉菜单不再难!!
2024-07-10 12:57:26
供稿:网友
<%@ page language="c#" %>
<html>
<!-- asp.net 2.0的例子 -->
<head runat="server">
</head>
<body>
<form runat="server">
<h3>下拉菜单的例子</h3>
<!-- use declarative syntax to create the -->
<!-- menu structure. submenu items are -->
<!-- created by nesting them in parent menu -->
<!-- items. -->
<asp:menu id="navigationmenu"
disappearafter="2000"
staticdisplaylevels="2"
staticsubmenuindent="10"
orientation="horizontal"
font-names="arial"
target="_blank"
runat="server">
<staticmenuitemstyle backcolor="#dddddd"
forecolor="red"/>
<statichoverstyle backcolor="#dddddd"/>
<dynamicmenuitemstyle backcolor="#eeeeee"
forecolor="red"/>
<dynamichoverstyle backcolor="#dddddd"
forecolor="black"/>
<items>
<asp:menuitem navigateurl="http://dotnet.aspx.cc/"
text="首页"
tooltip="首页">
<asp:menuitem navigateurl="http://dotnet.aspx.cc/showlist.aspx?id=1"
text="asp.net 栏目"
tooltip="asp.net 栏目">
<asp:menuitem navigateurl="classical.aspx"
text="asp.net 最新文章"
tooltip="asp.net 最新文章"/>
<asp:menuitem navigateurl="rock.aspx"
text="asp.net 问与答"
tooltip="asp.net 问与答">
<asp:menuitem navigateurl="classical.aspx"
text="asp.net 最新文章"
tooltip="asp.net 最新文章"/>
<asp:menuitem navigateurl="classical.aspx"
text="asp.net 最新文章"
tooltip="asp.net 最新文章"/>
</asp:menuitem>
<asp:menuitem navigateurl="jazz.aspx"
text="jazz"
tooltip="jazz"/>
</asp:menuitem>
<asp:menuitem navigateurl="movies.aspx"
text="movies"
tooltip="movies">
<asp:menuitem navigateurl="action.aspx"
text="action"
tooltip="action">
<asp:menuitem navigateurl="drama.aspx"
text="drama"
tooltip="drama"/>
</asp:menuitem>
<asp:menuitem navigateurl="drama.aspx"
text="drama"
tooltip="drama"/>
<asp:menuitem navigateurl="musical.aspx"
text="musical"
tooltip="musical"/>
</asp:menuitem>
</asp:menuitem>
</items>
</asp:menu>
</form>
</body>
</html>