ASPNET 提供了一个Menu 类可以方便地创建水平或者垂直方向的下拉菜单下面就是一个例子
<%@ Page Language=C# %>
<html>
<! ASPNET 的例子 >
<head runat=server>
</head>
<body>
<form runat=server>
<h>下拉菜单的例子</h>
<! Use declarative syntax to create the >
<! menu structure Submenu items are >
<! created by nesting them in parent menu >
<! items >
<asp:menu id=NavigationMenu
disappearafter=
staticdisplaylevels=
staticsubmenuindent=
orientation=Horizontal
fontnames=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=/
text=首页
tooltip=首页>
<asp:menuitem navigateurl=/ShowListaspx?id=
text=ASPNET 栏目
tooltip=ASPNET 栏目>
<asp:menuitem navigateurl=Classicalaspx
text=ASPNET 最新文章
tooltip=ASPNET 最新文章/>
<asp:menuitem navigateurl=Rockaspx
text=ASPNET 问与答
tooltip=ASPNET 问与答>
<asp:menuitem navigateurl=Classicalaspx
text=ASPNET 最新文章
tooltip=ASPNET 最新文章/>
<asp:menuitem navigateurl=Classicalaspx
text=ASPNET 最新文章
tooltip=ASPNET 最新文章/>
</asp:menuitem>
<asp:menuitem navigateurl=Jazzaspx
text=Jazz
tooltip=Jazz/>
</asp:menuitem>
<asp:menuitem navigateurl=Moviesaspx
text=Movies
tooltip=Movies>
<asp:menuitem navigateurl=Actionaspx
text=Action
tooltip=Action>
<asp:menuitem navigateurl=Dramaaspx
text=Drama
tooltip=Drama/>
</asp:menuitem>
<asp:menuitem navigateurl=Dramaaspx
text=Drama
tooltip=Drama/>
<asp:menuitem navigateurl=Musicalaspx
text=Musical
tooltip=Musical/>
</asp:menuitem>
</asp:menuitem>
</items>
</asp:menu>
</form>
</body>
</html>