Click here to Skip to main content
15,896,730 members
Articles / Web Development / ASP.NET

AMenu - A Simple .NET Vertical Menu

Rate me:
Please Sign up or sign in to vote.
4.88/5 (26 votes)
8 Oct 2009CPOL4 min read 64.1K   3.1K   100  
A CSS based .NET vertical menu control.
<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="ShopComputers.ascx.cs" Inherits="mtweb.ShopComputers" %>

<%@ Register TagPrefix="mt" Namespace="mtweb" Assembly="AMenu" %>

<!-- Start content_sections -->
<div class="content_sections" style="height:30em;">

  <!-- Start section -->
  <div class="section">

    <div class="section_title">
      <table width="100%">
      <tr>
        <td>Online Shopping: Computers</td>
        <td class="indicator">
          <asp:UpdateProgress ID="UpdateProgress" runat="server"
          DisplayAfter="200" AssociatedUpdatePanelID="UP2">
          <ProgressTemplate>
            <asp:Image ID="ImageAjax" runat="server" CssClass="image_ajax"
            ImageUrl="~/images/ajax2.gif" />
          </ProgressTemplate>
          </asp:UpdateProgress>
          <asp:ImageButton ID="ImageClose" runat="server" CssClass="image_close"
          ImageUrl="~/images/x3.gif" OnClick="OnCloseClick" />
        </td>
      </tr>
      </table>
    </div>
    
    <!-- Start section_menu -->
    <div class="section_menu">
      <mt:AMenu ID="Menu2" runat="server" Width="120px" Height="4em"
      SubWidth="100px" ArrowImage="~/images/menu/marrow.gif"
      OnItemClick="OnMenuItemClick" >
      
        <mt:MenuLink ID="Monitors" runat="server"
        IconImage="~/images/menu/monitor.gif" Text="Monitors">
        
          <mt:AMenuSub ID="AMenuSubMonitors" runat="server" >
            <mt:MenuLink ID="Monitors17" runat="server" Text="17'' LCD" 
            CommandName="Monitors" CommandArgument="17'' LCD Monitors" />
            
            <mt:MenuLink ID="Monitors19" runat="server" Text="19'' LCD" 
            CommandName="Monitors" CommandArgument="19'' LCD Monitors" />
            
            <mt:MenuLink ID="Monitors21" runat="server" Text="21'' LCD"
            CommandName="Monitors" CommandArgument="21'' LCD Monitors" />
            
            <mt:MenuLink ID="Monitors23" runat="server" Text="23'' LCD"
            CommandName="Monitors" CommandArgument="23'' LCD Monitors" />
          </mt:AMenuSub>
        </mt:MenuLink>
        
        <mt:MenuLink ID="Systems" runat="server"
        IconImage="~/images/menu/server.gif" Text="Systems">
        
          <mt:AMenuSub ID="AMenuSubSystems" runat="server" >
            <mt:MenuLink ID="Servers" runat="server" Text="Servers" 
            CommandName="Systems" CommandArgument="Server Systems" />
            
            <mt:MenuLink ID="Desktops" runat="server" Text="Desktops" 
            CommandName="Systems" CommandArgument="Desktop Systems" />
            
            <mt:MenuLink ID="Laptops" runat="server" Text="Laptops"
            CommandName="Systems" CommandArgument="Laptop Systems" />
          </mt:AMenuSub>
        </mt:MenuLink>
      
      </mt:AMenu>
    </div>
    <!-- End section_menu -->
    
    
    <div class="section_info">
      <asp:UpdatePanel ID="UP2" runat="server"
      UpdateMode="Conditional" ChildrenAsTriggers="false">
      <Triggers>
        <asp:AsyncPostBackTrigger ControlID="Menu2" EventName="ItemClick" />
      </Triggers>
      <ContentTemplate>
        <asp:Label ID="SelectionInfo" runat="server" />
      </ContentTemplate>
      </asp:UpdatePanel>
    </div> 

        
  </div>
  <!-- End section -->

</div>
<!-- End content_sections -->

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Europe Europe
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions