ASP.NET 2.0寫無限級下拉菜單
更新時間:2008年12月16日 15:29:04 作者:
ASP.NET 2.0提供了一個Menu 類,可以方便地創(chuàng)建水平或者垂直方向的下拉菜單,下面就是一個例子:

復制代碼 代碼如下:
<%@ 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>
相關文章
GridView中checkbox"全選/取消"完美兼容IE和Firefox
GridView中checkbox的的"全選/取消"使用還是比較頻繁的,本文有個不錯的示例完美兼容IE和Firefox,感興趣的朋友可以參考下,希望對大家有所幫助2013-10-10.Net?Core和RabbitMQ限制循環(huán)消費的方法
當消費者端接收消息處理業(yè)務時,如果出現(xiàn)異?;蚴蔷苁障⑾⒂肿兏鼮榈却哆f再次推送給消費者,這樣一來,則形成循環(huán)的條件,這篇文章主要介紹了.Net?Core和RabbitMQ限制循環(huán)消費的方法,需要的朋友可以參考下2022-10-10ASP.NET中MVC使用AJAX調用JsonResult方法并返回自定義錯誤信息
這篇文章主要介紹了ASP.NET中MVC使用AJAX調用JsonResult方法并返回自定義錯誤信息的相關資料,需要的朋友可以參考下2014-11-11國產化之銀河麒麟安裝.netcore3.1的詳細步驟(手動安裝)
這篇文章主要介紹了國產化之銀河麒麟安裝.netcore3.1的詳細步驟(手動安裝),本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2022-03-03Entity Framework加載控制Loading Entities
本文詳細講解了Entity Framework加載控制Loading Entities的用法,文中通過示例代碼介紹的非常詳細。對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2022-03-03.NET性能調優(yōu)之一:ANTS Performance Profiler的使用介紹
本系列文章主要會介紹一些.NET性能調優(yōu)的工具、Web性能優(yōu)化的規(guī)則(如YSlow)及方法等等內容。成文前最不希望看到的就是園子里不間斷的“哪個語言好,哪個語言性能高”的爭論,不多說,真正的明白人都應該知道這樣的爭論有沒有意義,希望我們能從實際性能優(yōu)化的角度去討論問題2013-01-01Entity?Framework代碼優(yōu)先Code?First入門
這篇文章介紹了Entity?Framework的代碼優(yōu)先模式Code?First,文中通過示例代碼介紹的非常詳細。對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2022-06-06