ASP.NET 2.0写无限级下拉菜单
更新时间:2008年12月16日 15:29:04 作者:
ASP.NET 2.0提供了一个Menu 类,可以方便地创建水平或者垂直方向的下拉菜单,下面就是一个例子:
复制代码 代码如下:
<%@ 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>
相关文章
在 ASP.Net Core 中使用 MiniProfiler的方法
这篇文章主要介绍了在 ASP.Net Core 中使用 MiniProfiler的方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下2021-03-03asp.net 文件上传与刷新与asp.net页面与iframe之间的数据传输
众所周知微软所提供的updatepanel不能支持文件上传的异步刷新,但是往往当你在项目中的其他页面实现了异步刷新之后,客户就会问你为什么有文件上传的页面就不能实现异步刷新呢?这时我们可能说一堆理由,但是最后大部分还是会妥协于客户。2009-12-12VS2005打开VS2008项目的2种方法(vs2005怎么打开2008)
vs2008支持.net3.5,而vs2005支持.net2.0,所以使用vs2005打开vs2008的项目,要确定你的项目是.net2.0的,下面介绍二种VS2005打开VS2008项目的方法2014-01-01Visual Studio 2017 ASP.NET Core开发
这篇文章主要为大家详细介绍了Visual Studio 2017 ASP.NET Core开发,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2017-03-03
最新评论